@zeniai/client-epic-state 5.1.52 → 5.1.53-betaRD1
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/commonStateTypes/amount.d.ts +0 -1
- package/lib/commonStateTypes/amount.js +1 -9
- package/lib/commonStateTypes/workingDayHelper.d.ts +3 -4
- package/lib/commonStateTypes/workingDayHelper.js +3 -4
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +1 -0
- package/lib/entity/aiCfo/aiCfoReducer.js +3 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +1 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -3
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/epic.d.ts +1 -7
- package/lib/epic.js +1 -7
- package/lib/esm/commonStateTypes/amount.js +0 -7
- package/lib/esm/commonStateTypes/workingDayHelper.js +3 -4
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +3 -1
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -4
- package/lib/esm/epic.js +1 -7
- package/lib/esm/index.js +0 -5
- package/lib/esm/reducer.js +0 -6
- package/lib/esm/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +18 -8
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +2 -22
- package/lib/esm/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +89 -39
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +57 -64
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +4 -1
- package/lib/esm/view/transactionDetail/transactionDetailReducer.js +2 -1
- package/lib/index.d.ts +1 -10
- package/lib/index.js +1 -20
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.d.ts +2 -2
- package/lib/view/recommendation/fetchEntityRecommendationsForLineUpdateEpic.js +17 -7
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +1 -8
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +1 -21
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +0 -22
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +88 -38
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +55 -62
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +4 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +2 -1
- package/lib/view/transactionDetail/transactionDetailReducer.js +2 -1
- package/lib/zeniAPI.d.ts +0 -1
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -29
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -78
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -49
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -47
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -32
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -54
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -92
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -212
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -10
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -23
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -36
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -27
- package/lib/esm/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -28
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.d.ts +0 -47
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowPayload.js +0 -34
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.d.ts +0 -23
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer.js +0 -82
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.d.ts +0 -40
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.d.ts +0 -37
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState.js +0 -53
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.d.ts +0 -14
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/fetchCashManagementSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/autoSweepFlow/epics/saveAutoSweepSettingsEpic.js +0 -36
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.d.ts +0 -56
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewPayload.js +0 -60
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.d.ts +0 -22
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer.js +0 -96
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.d.ts +0 -59
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector.js +0 -217
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.d.ts +0 -122
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState.js +0 -13
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementBannerEpic.js +0 -27
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.d.ts +0 -9
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementOverviewPageEpic.js +0 -40
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.d.ts +0 -7
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchCashManagementRecommendationEpic.js +0 -31
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.d.ts +0 -15
- package/lib/view/spendManagement/cashManagement/cashManagementOverview/epics/fetchRecentTransferEpic.js +0 -32
|
@@ -755,6 +755,7 @@ export const setEntityRecommendationForLineIdInLocalData = (transaction, transac
|
|
|
755
755
|
latestUpdatedLineWithEntity: transactionDetailLocalData.latestUpdatedLineWithEntity,
|
|
756
756
|
vendorBulkUpdateCategoryClassRecommendationsFetchStatus: transactionDetailLocalData.vendorBulkUpdateCategoryClassRecommendationsFetchStatus,
|
|
757
757
|
selectedEntity: transactionDetailLocalData.selectedEntity,
|
|
758
|
+
editMode: transactionDetailLocalData.editMode,
|
|
758
759
|
};
|
|
759
760
|
return newLocalData;
|
|
760
761
|
};
|
|
@@ -808,6 +809,7 @@ export const removeEntityRecommendationForLineIdInLocalData = (transaction, tran
|
|
|
808
809
|
latestSelectedEntityOnLineItem: transactionDetailLocalData.latestSelectedEntityOnLineItem,
|
|
809
810
|
latestUpdatedLineWithEntity: transactionDetailLocalData.latestUpdatedLineWithEntity,
|
|
810
811
|
selectedEntity: transactionDetailLocalData.selectedEntity,
|
|
812
|
+
editMode: transactionDetailLocalData.editMode,
|
|
811
813
|
};
|
|
812
814
|
return newLocalData;
|
|
813
815
|
};
|
|
@@ -827,7 +829,8 @@ export const getChangedLineItemCountFromLocalData = (transaction, transactionLoc
|
|
|
827
829
|
const accountLine = line;
|
|
828
830
|
hasCategoryChanged =
|
|
829
831
|
accountLineLocal.account?.qboId !== accountLine.account.qboId &&
|
|
830
|
-
accountLineLocal.account?.accountId !==
|
|
832
|
+
accountLineLocal.account?.accountId !==
|
|
833
|
+
accountLine.account.accountId;
|
|
831
834
|
hasClassChanged =
|
|
832
835
|
(accountLineLocal.class?.qboId != null ||
|
|
833
836
|
accountLine.class?.qboId != null) &&
|
|
@@ -190,12 +190,13 @@ const transactionDetail = createSlice({
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
|
-
prepare(transactionId, transactionSaveUpdates, isExpenseAutomationEnabled) {
|
|
193
|
+
prepare(transactionId, transactionSaveUpdates, isExpenseAutomationEnabled, lineIds) {
|
|
194
194
|
return {
|
|
195
195
|
payload: {
|
|
196
196
|
transactionId,
|
|
197
197
|
transactionSaveUpdates,
|
|
198
198
|
isExpenseAutomationEnabled,
|
|
199
|
+
lineIds,
|
|
199
200
|
},
|
|
200
201
|
};
|
|
201
202
|
},
|
package/lib/index.d.ts
CHANGED
|
@@ -972,7 +972,7 @@ export { TreasuryTaxLettersSelectorView, getTreasuryTaxLetters, } from './view/s
|
|
|
972
972
|
export { TreasuryTransactionStatus } from './view/spendManagement/treasury/treasuryList/treasuryDetailPayload';
|
|
973
973
|
export { fetchAutoTransferRules, createAutoTransferRule, updateAutoTransferRule, deleteAutoTransferRule, fetchAutoTransferRuleHistory, fetchAutoTransferReviewDetail, updateRuleLocalData, clearRuleUpdateLocalData, } from './view/spendManagement/autotransferRules/autoTransferRulesReducer';
|
|
974
974
|
export { AutoTransferRulesSelectorView, getAutoTransferRules, getAutoTransferRuleById, getAutoTransferRuleHistory, } from './view/spendManagement/autotransferRules/autoTransferRulesSelector';
|
|
975
|
-
export { AutoTransferRule,
|
|
975
|
+
export { AutoTransferRule, } from './view/spendManagement/autotransferRules/autoTransferRulesState';
|
|
976
976
|
export { AutoTransferRuleType, AutoTransferRuleFrequency, AutoTransferRuleLocalData, } from './view/spendManagement/autotransferRules/autoTransferRulesPayload';
|
|
977
977
|
export type { TransactionActivityLog } from './entity/transactionActivityLog/transactionActivityLogState';
|
|
978
978
|
export { BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS, BULK_UPLOAD_BAR_COMPLETE_HOLD_MS, } from './view/expenseAutomationView/helpers/bulkUploadTiming';
|
|
@@ -984,12 +984,3 @@ export type { SessionCallbacks, SessionConfig, } from './entity/tenant/sessionTy
|
|
|
984
984
|
export { DEFAULT_SESSION_CONFIG } from './entity/tenant/sessionTypes';
|
|
985
985
|
export type { KybProvidedDocumentType, KycKybAutofillTarget, KycKybProvidedDocumentType, KycProvidedDocumentType, KycSelectDocumentType, } from './view/spendManagement/commonSetup/types/kycKybAutofill';
|
|
986
986
|
export { toKycProvidedDocumentType, toKycProvidedDocumentTypeFromAllowed, } from './view/spendManagement/commonSetup/types/kycKybAutofill';
|
|
987
|
-
export { fetchCashManagementBanner, fetchCashManagementOverviewPage, } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer';
|
|
988
|
-
export { clearAutoSweepFlow, saveAutoSweepSettings, updateAutoSweepDraft, updateAutoSweepRisk, updateAutoSweepSettingsFetchStatus, updateCashManagementSettings, updateCashManagementSettingsFetchStatus, } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer';
|
|
989
|
-
export { getAutoSweepFlow } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector';
|
|
990
|
-
export type { AutoSweepFlowFormData, AutoSweepFlowSelectorView, } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector';
|
|
991
|
-
export { RISK_BUFFER_AMOUNT, bufferAmountToRisk, } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
992
|
-
export type { AutoSweepFlowState, AutoSweepFrequency, RiskLevel, } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
993
|
-
export { getCashManagementOverview, getCashManagementOverviewBanner, } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector';
|
|
994
|
-
export type { CashManagementOverviewBannerSelectorView, CashManagementOverviewSelectorView, CashProjectionPoint, } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector';
|
|
995
|
-
export type { CashManagementScenario, CashManagementTransfer, CashManagementTransferStatus, UpcomingPaymentEvent, UpcomingPaymentEventAccountType, } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState';
|
package/lib/index.js
CHANGED
|
@@ -76,7 +76,7 @@ exports.toAiCfoVisualizationType = exports.ALL_INTERACTIVE_FORM_TYPES = exports.
|
|
|
76
76
|
exports.getPolicyRecommendationFromUploadError = exports.getPolicyRecommendationFromUploadChatSessionId = exports.getPolicyRecommendationFromUploadAnswerId = exports.getPolicyDocumentExtractionFetchState = exports.getPolicyDocumentExtractionError = exports.getExtractedCardPolicyRules = exports.getCardPolicyVendorSearchString = exports.getCardPolicyVendorSearchOptions = exports.getCardPolicyVendorSearchFetchState = exports.getCardPolicyTemplatesByIds = exports.getCardPolicyTemplateById = exports.getCardPolicySuggestedBlockMerchants = exports.getCardPolicySuggestedBlockCategories = exports.getCardPolicySuggestedAllowMerchants = exports.getCardPolicySuggestedAllowCategories = exports.getCardPolicyStats = exports.getCardPolicyMccCategoriesFetchState = exports.getCardPolicyMccCategoriesError = exports.getCardPolicyMccCategories = exports.getAllCardPolicyTemplates = exports.clearCardPolicy = exports.updatePolicyRecommendationFromUploadSuccess = exports.updatePolicyRecommendationFromUploadFailure = exports.updatePolicyDocumentExtractionSuccess = exports.updatePolicyDocumentExtractionFailure = exports.updateCreatedCardPolicyTemplate = exports.updateCardPolicyVendorOptionsFailure = exports.updateCardPolicyVendorOptions = exports.updateCardPolicyTemplates = exports.updateCardPolicyStats = exports.updateCardPolicyMccCategoriesFailure = exports.updateCardPolicyMccCategories = exports.removeCardPolicyTemplate = exports.fetchCardPolicyVendorOptions = exports.fetchCardPolicyRecommendationFromUpload = exports.fetchCardPolicyMccCategories = exports.extractPolicyDocument = exports.clearPolicyDocumentExtraction = exports.toMessageType = exports.toMessageSender = exports.ALL_SYNTHETIC_AI_CFO_ANSWER_KINDS = exports.toInteractiveFormTypeStrict = exports.toInteractiveFormType = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = void 0;
|
|
77
77
|
exports.applyAiCardPolicyFormDraftUpdate = exports.deriveAiPolicyReviewRowsFromInputs = exports.buildManualCardPolicyFormDraftSeed = exports.buildUploadReviewRows = exports.buildEmptyLimitRows = exports.buildAiCardPolicyFormDraftSeed = exports.toVendorChipFieldValue = exports.toMccCategoryChipFieldValue = exports.buildVendorChipId = exports.buildMccCategoryChipId = exports.VENDOR_CHIP_ID_PREFIX = exports.MCC_CHIP_ID_PREFIX = exports.toMccCategoryLike = exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION = exports.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT = exports.getManualCardPolicyFormDraft = exports.getLastCreatedCardPolicyTemplateIds = exports.getLastCreatedCardPolicyTemplateId = exports.getLastCreateCardPolicyTemplateErrors = exports.getLastCreateCardPolicySourceChatSessionId = exports.getCreateCardPolicyTemplateRequestState = exports.getAiCardPolicyFormDraft = exports.updateManualCardPolicyFormDraft = exports.updateCreateCardPolicyTemplateRequestState = exports.updateAiCardPolicyFormDraftFromUploadPlan = exports.updateAiCardPolicyFormDraft = exports.seedManualCardPolicyFormDraft = exports.seedAiCardPolicyFormDraft = exports.createCardPolicyTemplates = exports.clearManualCardPolicyFormDraft = exports.clearCreateCardPolicy = exports.clearAiCardPolicyFormDraft = exports.applyExtractedPolicyToManualCardPolicyDraft = exports.applyExtractedPolicyToAiCardPolicyDraft = exports.toUpdateCardPolicyTemplateRequestBody = exports.toExtractedCardPolicyRules = exports.toCreateCardPolicyTemplatesRequestBody = exports.toCreateCardPolicyTemplateRequestBody = exports.toCardPolicyVendorSearchOption = exports.toCardPolicyTemplateList = exports.toCardPolicyTemplate = exports.toCardPolicyStats = exports.toCardPolicyEditFormDraft = exports.toBulkCreateCardPolicyTemplateError = exports.toCardPolicyTemplateStatus = exports.toCardPolicyTemplateMode = exports.ALL_CARD_POLICY_TEMPLATE_STATUSES = exports.ALL_CARD_POLICY_TEMPLATE_MODES = exports.getUploadedPolicyDocumentFileName = exports.getPolicyRecommendationFromUploadFetchState = void 0;
|
|
78
78
|
exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.getUpdateCardPolicyFetchState = exports.getCardPolicyFormDraft = exports.getCardPolicyDetailView = exports.getCardPolicyDetailFetchState = exports.updateCardPolicyFormDraft = exports.updateCardPolicyFetchStatus = exports.updateCardPolicyDetailFetchStatus = exports.updateCardPolicy = exports.fetchCardPolicyDetail = exports.clearCardPolicyDetail = exports.getCardPolicyTemplateIds = exports.getCardPolicyListView = exports.getCardPolicyListFetchState = exports.getArchiveCardPolicyFetchState = exports.updateCardPolicyListFetchStatus = exports.updateArchiveCardPolicyFetchStatus = exports.prependCardPolicyTemplateIds = exports.fetchCardPolicyList = exports.clearCardPolicyList = exports.archiveCardPolicy = exports.toManualCardPolicyTemplateRequestFromDraft = exports.toBulkCardPolicyTemplateRequestsFromDraft = exports.toCardPolicyTemplateRequestFromDraft = void 0;
|
|
79
|
-
exports.
|
|
79
|
+
exports.toKycProvidedDocumentTypeFromAllowed = exports.toKycProvidedDocumentType = exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = void 0;
|
|
80
80
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
81
81
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
82
82
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -2595,22 +2595,3 @@ Object.defineProperty(exports, "DEFAULT_SESSION_CONFIG", { enumerable: true, get
|
|
|
2595
2595
|
var kycKybAutofill_1 = require("./view/spendManagement/commonSetup/types/kycKybAutofill");
|
|
2596
2596
|
Object.defineProperty(exports, "toKycProvidedDocumentType", { enumerable: true, get: function () { return kycKybAutofill_1.toKycProvidedDocumentType; } });
|
|
2597
2597
|
Object.defineProperty(exports, "toKycProvidedDocumentTypeFromAllowed", { enumerable: true, get: function () { return kycKybAutofill_1.toKycProvidedDocumentTypeFromAllowed; } });
|
|
2598
|
-
var cashManagementOverviewReducer_1 = require("./view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer");
|
|
2599
|
-
Object.defineProperty(exports, "fetchCashManagementBanner", { enumerable: true, get: function () { return cashManagementOverviewReducer_1.fetchCashManagementBanner; } });
|
|
2600
|
-
Object.defineProperty(exports, "fetchCashManagementOverviewPage", { enumerable: true, get: function () { return cashManagementOverviewReducer_1.fetchCashManagementOverviewPage; } });
|
|
2601
|
-
var autoSweepFlowReducer_1 = require("./view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer");
|
|
2602
|
-
Object.defineProperty(exports, "clearAutoSweepFlow", { enumerable: true, get: function () { return autoSweepFlowReducer_1.clearAutoSweepFlow; } });
|
|
2603
|
-
Object.defineProperty(exports, "saveAutoSweepSettings", { enumerable: true, get: function () { return autoSweepFlowReducer_1.saveAutoSweepSettings; } });
|
|
2604
|
-
Object.defineProperty(exports, "updateAutoSweepDraft", { enumerable: true, get: function () { return autoSweepFlowReducer_1.updateAutoSweepDraft; } });
|
|
2605
|
-
Object.defineProperty(exports, "updateAutoSweepRisk", { enumerable: true, get: function () { return autoSweepFlowReducer_1.updateAutoSweepRisk; } });
|
|
2606
|
-
Object.defineProperty(exports, "updateAutoSweepSettingsFetchStatus", { enumerable: true, get: function () { return autoSweepFlowReducer_1.updateAutoSweepSettingsFetchStatus; } });
|
|
2607
|
-
Object.defineProperty(exports, "updateCashManagementSettings", { enumerable: true, get: function () { return autoSweepFlowReducer_1.updateCashManagementSettings; } });
|
|
2608
|
-
Object.defineProperty(exports, "updateCashManagementSettingsFetchStatus", { enumerable: true, get: function () { return autoSweepFlowReducer_1.updateCashManagementSettingsFetchStatus; } });
|
|
2609
|
-
var autoSweepFlowSelector_1 = require("./view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowSelector");
|
|
2610
|
-
Object.defineProperty(exports, "getAutoSweepFlow", { enumerable: true, get: function () { return autoSweepFlowSelector_1.getAutoSweepFlow; } });
|
|
2611
|
-
var autoSweepFlowState_1 = require("./view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState");
|
|
2612
|
-
Object.defineProperty(exports, "RISK_BUFFER_AMOUNT", { enumerable: true, get: function () { return autoSweepFlowState_1.RISK_BUFFER_AMOUNT; } });
|
|
2613
|
-
Object.defineProperty(exports, "bufferAmountToRisk", { enumerable: true, get: function () { return autoSweepFlowState_1.bufferAmountToRisk; } });
|
|
2614
|
-
var cashManagementOverviewSelector_1 = require("./view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewSelector");
|
|
2615
|
-
Object.defineProperty(exports, "getCashManagementOverview", { enumerable: true, get: function () { return cashManagementOverviewSelector_1.getCashManagementOverview; } });
|
|
2616
|
-
Object.defineProperty(exports, "getCashManagementOverviewBanner", { enumerable: true, get: function () { return cashManagementOverviewSelector_1.getCashManagementOverviewBanner; } });
|
package/lib/reducer.d.ts
CHANGED
|
@@ -157,8 +157,6 @@ import { InternationalWireVerificationState } from './view/spendManagement/billP
|
|
|
157
157
|
import { MagicLinkViewState } from './view/spendManagement/billPay/magicLinkView/magicLinkViewState';
|
|
158
158
|
import { PreviousBillsState } from './view/spendManagement/billPay/previousBills/previousBillsState';
|
|
159
159
|
import { WiseRedirectState } from './view/spendManagement/billPay/wiseRedirectView/wiseRedirectState';
|
|
160
|
-
import { AutoSweepFlowState } from './view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
161
|
-
import { CashManagementOverviewState } from './view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewState';
|
|
162
160
|
import { CardPolicyDetailState } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState';
|
|
163
161
|
import { CardPolicyListState } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState';
|
|
164
162
|
import { CreateCardPolicyState } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState';
|
|
@@ -312,7 +310,6 @@ type ViewsState = {
|
|
|
312
310
|
arAgingState: ArAgingState;
|
|
313
311
|
auditReportViewState: AuditReportViewState;
|
|
314
312
|
authenticationViewState: AuthenticationViewState;
|
|
315
|
-
autoSweepFlowState: AutoSweepFlowState;
|
|
316
313
|
autotransferRulesState: AutoTransferRulesState;
|
|
317
314
|
balanceSheetState: BalanceSheetState;
|
|
318
315
|
bankAccountViewState: BankAccountViewState;
|
|
@@ -334,7 +331,6 @@ type ViewsState = {
|
|
|
334
331
|
cashBalanceState: CashBalanceState;
|
|
335
332
|
cashFlowState: CashFlowState;
|
|
336
333
|
cashInCashOutState: CashInCashOutState;
|
|
337
|
-
cashManagementOverviewState: CashManagementOverviewState;
|
|
338
334
|
cashPositionState: CashPositionState;
|
|
339
335
|
chargeCardConfigState: ChargeCardConfigState;
|
|
340
336
|
chargeCardDetailState: ChargeCardDetailState;
|
|
@@ -480,7 +476,6 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
480
476
|
arAgingState: ArAgingState;
|
|
481
477
|
auditReportViewState: AuditReportViewState;
|
|
482
478
|
authenticationViewState: AuthenticationViewState;
|
|
483
|
-
autoSweepFlowState: AutoSweepFlowState;
|
|
484
479
|
autotransferRulesState: AutoTransferRulesState;
|
|
485
480
|
balanceSheetState: BalanceSheetState;
|
|
486
481
|
bankAccountViewState: BankAccountViewState;
|
|
@@ -500,7 +495,6 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
500
495
|
cashBalanceState: CashBalanceState;
|
|
501
496
|
cashFlowState: CashFlowState;
|
|
502
497
|
cashInCashOutState: CashInCashOutState;
|
|
503
|
-
cashManagementOverviewState: CashManagementOverviewState;
|
|
504
498
|
cashPositionState: CashPositionState;
|
|
505
499
|
chargeCardConfigState: ChargeCardConfigState;
|
|
506
500
|
chargeCardDetailState: ChargeCardDetailState;
|
package/lib/reducer.js
CHANGED
|
@@ -198,8 +198,6 @@ const internationalWireVerificationReducer_1 = __importStar(require("./view/spen
|
|
|
198
198
|
const magicLinkViewReducer_1 = __importStar(require("./view/spendManagement/billPay/magicLinkView/magicLinkViewReducer"));
|
|
199
199
|
const previousBillsReducer_1 = __importStar(require("./view/spendManagement/billPay/previousBills/previousBillsReducer"));
|
|
200
200
|
const wiseRedirectReducer_1 = __importStar(require("./view/spendManagement/billPay/wiseRedirectView/wiseRedirectReducer"));
|
|
201
|
-
const autoSweepFlowReducer_1 = __importStar(require("./view/spendManagement/cashManagement/autoSweepFlow/autoSweepFlowReducer"));
|
|
202
|
-
const cashManagementOverviewReducer_1 = __importStar(require("./view/spendManagement/cashManagement/cashManagementOverview/cashManagementOverviewReducer"));
|
|
203
201
|
const cardPolicyDetailReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer"));
|
|
204
202
|
const cardPolicyListReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer"));
|
|
205
203
|
const createCardPolicyReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer"));
|
|
@@ -355,7 +353,6 @@ const initialViewsState = {
|
|
|
355
353
|
arAgingState: arAgingReducer_1.initialState,
|
|
356
354
|
auditReportViewState: auditReportViewReducer_1.initialState,
|
|
357
355
|
authenticationViewState: authenticationViewReducer_1.initialState,
|
|
358
|
-
autoSweepFlowState: autoSweepFlowReducer_1.initialState,
|
|
359
356
|
autotransferRulesState: autoTransferRulesReducer_1.initialState,
|
|
360
357
|
balanceSheetState: balanceSheetReducer_1.initialState,
|
|
361
358
|
bankAccountViewState: bankAccountViewReducer_1.initialState,
|
|
@@ -376,7 +373,6 @@ const initialViewsState = {
|
|
|
376
373
|
cashBalanceState: cashBalanceReducer_1.initialState,
|
|
377
374
|
cashFlowState: cashFlowReducer_1.initialState,
|
|
378
375
|
cashInCashOutState: cashInCashOutReducer_1.initialState,
|
|
379
|
-
cashManagementOverviewState: cashManagementOverviewReducer_1.initialState,
|
|
380
376
|
cashPositionState: cashPositionReducer_1.initialState,
|
|
381
377
|
chargeCardConfigState: chargeCardConfigReducer_1.initialState,
|
|
382
378
|
chargeCardDetailState: chargeCardDetailReducer_1.initialState,
|
|
@@ -598,7 +594,6 @@ const viewReducers = {
|
|
|
598
594
|
arAgingState: arAgingReducer_1.default,
|
|
599
595
|
auditReportViewState: auditReportViewReducer_1.default,
|
|
600
596
|
authenticationViewState: authenticationViewReducer_1.default,
|
|
601
|
-
autoSweepFlowState: autoSweepFlowReducer_1.default,
|
|
602
597
|
autotransferRulesState: autoTransferRulesReducer_1.default,
|
|
603
598
|
balanceSheetState: balanceSheetReducer_1.default,
|
|
604
599
|
bankAccountViewState: bankAccountViewReducer_1.default,
|
|
@@ -618,7 +613,6 @@ const viewReducers = {
|
|
|
618
613
|
cashBalanceState: cashBalanceReducer_1.default,
|
|
619
614
|
cashFlowState: cashFlowReducer_1.default,
|
|
620
615
|
cashInCashOutState: cashInCashOutReducer_1.default,
|
|
621
|
-
cashManagementOverviewState: cashManagementOverviewReducer_1.default,
|
|
622
616
|
cashPositionState: cashPositionReducer_1.default,
|
|
623
617
|
chargeCardConfigState: chargeCardConfigReducer_1.default,
|
|
624
618
|
chargeCardDetailState: chargeCardDetailReducer_1.default,
|
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { RootState } from '../../reducer';
|
|
4
4
|
import { ZeniAPI } from '../../zeniAPI';
|
|
5
5
|
import { markCategoryClassRecommendationsCompletedForCategorization, markCategoryClassRecommendationsFailureForCategorization, markCategoryClassRecommendationsInProgressForCategorization, setEntityRecommendationForLineIdsForCategorization } from '../expenseAutomationView/reducers/transactionsViewReducer';
|
|
6
|
-
import { markCategoryClassRecommendationsCompletedForTransactionDetail, markCategoryClassRecommendationsFailureForTransactionDetail, markCategoryClassRecommendationsInProgressForTransactionDetail, setEntityRecommendationForLineIdsForTransactionDetail } from '../transactionDetail/transactionDetailReducer';
|
|
6
|
+
import { markCategoryClassRecommendationsCompletedForTransactionDetail, markCategoryClassRecommendationsFailureForTransactionDetail, markCategoryClassRecommendationsInProgressForTransactionDetail, setEntityRecommendationForLineIdsForTransactionDetail, updateVendorBulkRecommendationsFetchStatus } from '../transactionDetail/transactionDetailReducer';
|
|
7
7
|
import { fetchEntityRecommendationsForLineUpdate } from './recommendationReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof fetchEntityRecommendationsForLineUpdate> | ReturnType<typeof markCategoryClassRecommendationsInProgressForCategorization> | ReturnType<typeof markCategoryClassRecommendationsCompletedForCategorization> | ReturnType<typeof markCategoryClassRecommendationsFailureForCategorization> | ReturnType<typeof markCategoryClassRecommendationsInProgressForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsCompletedForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsFailureForTransactionDetail> | ReturnType<typeof setEntityRecommendationForLineIdsForCategorization> | ReturnType<typeof setEntityRecommendationForLineIdsForTransactionDetail>;
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchEntityRecommendationsForLineUpdate> | ReturnType<typeof markCategoryClassRecommendationsInProgressForCategorization> | ReturnType<typeof markCategoryClassRecommendationsCompletedForCategorization> | ReturnType<typeof markCategoryClassRecommendationsFailureForCategorization> | ReturnType<typeof markCategoryClassRecommendationsInProgressForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsCompletedForTransactionDetail> | ReturnType<typeof markCategoryClassRecommendationsFailureForTransactionDetail> | ReturnType<typeof setEntityRecommendationForLineIdsForCategorization> | ReturnType<typeof setEntityRecommendationForLineIdsForTransactionDetail> | ReturnType<typeof updateVendorBulkRecommendationsFetchStatus>;
|
|
9
9
|
export declare const fetchEntityRecommendationsForLineUpdateEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -41,6 +41,16 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
41
41
|
const payload = action.payload;
|
|
42
42
|
const { transactionId, transaction, lineIds } = payload.transactionDetails;
|
|
43
43
|
const { entity, amount, isFetchCOT, isUncategorizedExpenseCategoryEnabled, } = payload;
|
|
44
|
+
// The vendor "Update all lines" popup on the detail page watches
|
|
45
|
+
// its own transaction-level fetch status, separate from the
|
|
46
|
+
// per-line statuses below — surface completion/failure there too
|
|
47
|
+
// when this fetch was triggered by that bulk action, or the popup
|
|
48
|
+
// hangs until its own 60s timeout regardless of how this request
|
|
49
|
+
// resolves.
|
|
50
|
+
const isBulkDetailFetch = payload.flowType === 'detail' && payload.isBulkFetch === true;
|
|
51
|
+
const emitWithBulkStatus = (primaryAction, bulkAction) => isBulkDetailFetch && bulkAction != null
|
|
52
|
+
? (0, rxjs_1.of)(primaryAction, bulkAction)
|
|
53
|
+
: (0, rxjs_1.of)(primaryAction);
|
|
44
54
|
// Synchronously emit the start arm so the per-line skeleton +
|
|
45
55
|
// row uncheck happen before the HTTP request begins. The
|
|
46
56
|
// discriminated-union payload narrows `payload.selectedTab` to
|
|
@@ -54,9 +64,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
54
64
|
.getJSON(url)
|
|
55
65
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
56
66
|
if (!(0, responsePayload_1.isSuccessResponse)(response) || response.data == null) {
|
|
57
|
-
return (
|
|
67
|
+
return emitWithBulkStatus(payload.flowType === 'categorization'
|
|
58
68
|
? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, response.status)
|
|
59
|
-
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, response.status));
|
|
69
|
+
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, response.status), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Error', response.status));
|
|
60
70
|
}
|
|
61
71
|
const recommendationWithCOTByLineId = (0, recommendationHelper_1.getRecommendationByLineIdWithCOTFromRecommendationPayloadWithCOT)(response.data.recommendations, lineIds);
|
|
62
72
|
// HTTP 200 with no per-line recommendations: NOT an error.
|
|
@@ -64,9 +74,9 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
64
74
|
// downstream UI can treat this as "we tried, nothing to
|
|
65
75
|
// apply".
|
|
66
76
|
if (recommendationWithCOTByLineId == null) {
|
|
67
|
-
return (
|
|
77
|
+
return emitWithBulkStatus(payload.flowType === 'categorization'
|
|
68
78
|
? (0, transactionsViewReducer_1.markCategoryClassRecommendationsCompletedForCategorization)(payload.selectedTab, transactionId, lineIds)
|
|
69
|
-
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsCompletedForTransactionDetail)(transactionId, lineIds));
|
|
79
|
+
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsCompletedForTransactionDetail)(transactionId, lineIds), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed'));
|
|
70
80
|
}
|
|
71
81
|
const transactionWithCOT = isFetchCOT === true
|
|
72
82
|
? (0, transactionHelper_1.getTransactionWithCOTFromRecommendations)(transaction, recommendationWithCOTByLineId)
|
|
@@ -75,16 +85,16 @@ const fetchEntityRecommendationsForLineUpdateEpic = (actions$, state$, zeniAPI)
|
|
|
75
85
|
if (payload.flowType === 'categorization') {
|
|
76
86
|
return (0, rxjs_1.of)((0, transactionsViewReducer_1.setEntityRecommendationForLineIdsForCategorization)(payload.selectedTab, transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled, (0, tenantSelector_1.getIsAccountingClassesEnabled)(state$.value)));
|
|
77
87
|
}
|
|
78
|
-
return (
|
|
88
|
+
return emitWithBulkStatus((0, transactionDetailReducer_1.setEntityRecommendationForLineIdsForTransactionDetail)(transactionId, transactionWithCOT, lineIds, entity, amount, recommendationWithCOTByLineId, uncategorizedIncomeExpense), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Completed'));
|
|
79
89
|
}), (0, operators_1.catchError)((error) => {
|
|
80
90
|
const errorMessage = 'fetchEntityRecommendationsForLineUpdate failed: ' +
|
|
81
91
|
(error instanceof Error
|
|
82
92
|
? error.message
|
|
83
93
|
: JSON.stringify(error));
|
|
84
94
|
const status = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', errorMessage);
|
|
85
|
-
return (
|
|
95
|
+
return emitWithBulkStatus(payload.flowType === 'categorization'
|
|
86
96
|
? (0, transactionsViewReducer_1.markCategoryClassRecommendationsFailureForCategorization)(payload.selectedTab, transactionId, lineIds, status)
|
|
87
|
-
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, status));
|
|
97
|
+
: (0, transactionDetailReducer_1.markCategoryClassRecommendationsFailureForTransactionDetail)(transactionId, lineIds, status), (0, transactionDetailReducer_1.updateVendorBulkRecommendationsFetchStatus)(transactionId, 'Error', status));
|
|
88
98
|
}));
|
|
89
99
|
return (0, rxjs_1.concat)((0, rxjs_1.of)(startAction), httpStream$);
|
|
90
100
|
}))));
|
|
@@ -6,7 +6,7 @@ import { FundingAccount } from '../commonSetup/setupViewSelector';
|
|
|
6
6
|
import { TreasuryAccount } from '../treasury/treasuryTransferMoney/treasuryTransferMoneyState';
|
|
7
7
|
import { ReviewTransferDetail } from '../zeniAccounts/transferDetail/transferDetailState';
|
|
8
8
|
import { AutoTransferRuleLocalData } from './autoTransferRulesPayload';
|
|
9
|
-
import { AutoTransferRule
|
|
9
|
+
import { AutoTransferRule } from './autoTransferRulesState';
|
|
10
10
|
export interface AutoTransferRulesSelectorView extends SelectorView {
|
|
11
11
|
autoTransferReviewDetail: ReviewTransferDetail;
|
|
12
12
|
createRuleFetchState: FetchStateAndError;
|
|
@@ -17,13 +17,6 @@ export interface AutoTransferRulesSelectorView extends SelectorView {
|
|
|
17
17
|
transferMoneyParties: FundingAccount[];
|
|
18
18
|
transferMoneyPartiesFetchState: FetchState;
|
|
19
19
|
treasuryAccount: TreasuryAccount;
|
|
20
|
-
/**
|
|
21
|
-
* The user's saved auto-sweep cash-management config, surfaced here so the
|
|
22
|
-
* rules list page can render it alongside the auto-transfer rules.
|
|
23
|
-
* `undefined` when the user hasn't saved auto-sweep settings yet
|
|
24
|
-
* (i.e. `autoSweepFlowState.settingsId == null`).
|
|
25
|
-
*/
|
|
26
|
-
cashManagementRule?: CashManagementRule;
|
|
27
20
|
ruleHistory?: Record<string, CommonHistoryView>;
|
|
28
21
|
}
|
|
29
22
|
export declare const getAutoTransferRules: (state: RootState) => AutoTransferRulesSelectorView;
|
|
@@ -6,30 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
9
|
-
const depositAccountSelector_1 = require("../../../entity/depositAccount/depositAccountSelector");
|
|
10
9
|
const setupViewSelector_1 = require("../commonSetup/setupViewSelector");
|
|
11
10
|
const depositAccountListSelector_1 = require("../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
12
11
|
const paymentAccountListSelector_1 = require("../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
13
|
-
const buildCashManagementRule = (autoSweepFlowState, depositAccountState, treasuryDetailState) => {
|
|
14
|
-
const { settingsId, bufferAmount, frequency, memo, primaryFundingAccountId, nextTransferDate, } = autoSweepFlowState;
|
|
15
|
-
if (settingsId == null || primaryFundingAccountId == null) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
const depositAccount = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, primaryFundingAccountId);
|
|
19
|
-
return {
|
|
20
|
-
bufferAmount,
|
|
21
|
-
frequency,
|
|
22
|
-
memo,
|
|
23
|
-
settingsId,
|
|
24
|
-
primaryFundingAccount: depositAccount != null
|
|
25
|
-
? (0, setupViewSelector_1.mapDepositAccToFundingAccount)(depositAccount)
|
|
26
|
-
: undefined,
|
|
27
|
-
treasurySummary: treasuryDetailState.accountSummary,
|
|
28
|
-
nextTransferDate,
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
12
|
const getAutoTransferRules = (state) => {
|
|
32
|
-
const { autotransferRulesState,
|
|
13
|
+
const { autotransferRulesState, depositAccountState, paymentAccountState, depositAccountListState, paymentAccountListState, treasuryDetailState, } = state;
|
|
33
14
|
const { rules, error, historyByRuleId, ruleUpdateLocalData, ruleUpdateStatusById, ruleDeleteStatusById, createRuleFetchState, autoTransferReviewDetail, } = autotransferRulesState;
|
|
34
15
|
const depositAccountsView = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState);
|
|
35
16
|
const paymentAccountsView = (0, paymentAccountListSelector_1.getAllPaymentAccounts)(paymentAccountState, paymentAccountListState);
|
|
@@ -64,7 +45,6 @@ const getAutoTransferRules = (state) => {
|
|
|
64
45
|
transferMoneyParties,
|
|
65
46
|
transferMoneyPartiesFetchState,
|
|
66
47
|
createRuleFetchState,
|
|
67
|
-
cashManagementRule: buildCashManagementRule(autoSweepFlowState, depositAccountState, treasuryDetailState),
|
|
68
48
|
fetchState,
|
|
69
49
|
error,
|
|
70
50
|
version: 0,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { Amount } from '../../../commonStateTypes/amount';
|
|
2
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
3
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
|
-
import { AutoSweepFrequency } from '../cashManagement/autoSweepFlow/autoSweepFlowState';
|
|
5
3
|
import { CommonHistoryView } from '../commonHistoryView/commonHistory';
|
|
6
|
-
import { FundingAccount } from '../commonSetup/setupViewSelector';
|
|
7
|
-
import { TreasurySummaryWithBalance } from '../treasury/treasuryList/treasuryDetailState';
|
|
8
4
|
import { ReviewTransferDetail } from '../zeniAccounts/transferDetail/transferDetailState';
|
|
9
5
|
import { AutoTransferRuleFrequency, AutoTransferRuleLocalData, AutoTransferRuleType } from './autoTransferRulesPayload';
|
|
10
6
|
export interface AutoTransferRule {
|
|
@@ -31,24 +27,6 @@ export interface DestinationBankAccountMetadata {
|
|
|
31
27
|
accountType: string;
|
|
32
28
|
percentage: number;
|
|
33
29
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Render-ready view of the user's auto-sweep cash-management config,
|
|
36
|
-
* surfaced alongside `AutoTransferRule[]` in `AutoTransferRulesSelectorView`.
|
|
37
|
-
* Kept as a distinct shape (not folded into `AutoTransferRule`) so the rules
|
|
38
|
-
* list can special-case its rendering without polluting the rule type union.
|
|
39
|
-
*
|
|
40
|
-
* Present only when `autoSweepFlowState.settingsId` is set — i.e. the user
|
|
41
|
-
* has saved their auto-sweep settings at least once.
|
|
42
|
-
*/
|
|
43
|
-
export interface CashManagementRule {
|
|
44
|
-
bufferAmount: Amount;
|
|
45
|
-
frequency: AutoSweepFrequency;
|
|
46
|
-
memo: string;
|
|
47
|
-
settingsId: ID;
|
|
48
|
-
nextTransferDate?: ZeniDate;
|
|
49
|
-
primaryFundingAccount?: FundingAccount;
|
|
50
|
-
treasurySummary?: TreasurySummaryWithBalance;
|
|
51
|
-
}
|
|
52
30
|
export interface AutoTransferRulesState extends FetchedState {
|
|
53
31
|
autoTransferReviewDetail: ReviewTransferDetail;
|
|
54
32
|
createRuleFetchState: FetchStateAndError;
|
|
@@ -7,11 +7,99 @@ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
|
|
|
7
7
|
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const tenantSelector_1 = require("../../../entity/tenant/tenantSelector");
|
|
9
9
|
const transactionReducer_1 = require("../../../entity/transaction/transactionReducer");
|
|
10
|
+
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
10
11
|
const responsePayload_1 = require("../../../responsePayload");
|
|
11
12
|
const transactionsViewReducer_1 = require("../../expenseAutomationView/reducers/transactionsViewReducer");
|
|
12
13
|
const transactionDetailReducer_1 = require("../transactionDetailReducer");
|
|
13
14
|
const transactionDetailState_1 = require("../transactionDetailState");
|
|
14
15
|
const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.markTransactionAsNotMiscategorized.match), (0, operators_1.mergeMap)((action) => {
|
|
16
|
+
if (action.payload.isExpenseAutomationEnabled === true) {
|
|
17
|
+
const transactionKey = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
18
|
+
const transaction = (0, transactionSelector_1.getSupportedTransactionById)(state$.value.transactionState, transactionKey);
|
|
19
|
+
const lineIds = (action.payload.lineIds?.length ?? 0) > 0
|
|
20
|
+
? action.payload.lineIds
|
|
21
|
+
: (transaction?.lines ?? []).map((line) => line.id);
|
|
22
|
+
return zeniAPI
|
|
23
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/mark-as-reviewed`, {
|
|
24
|
+
transactions_reviewed: [
|
|
25
|
+
{
|
|
26
|
+
transaction_id: action.payload.transactionId.id,
|
|
27
|
+
line_ids: lineIds,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
})
|
|
31
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
32
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
33
|
+
const actions = [];
|
|
34
|
+
actions.push((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Completed', undefined));
|
|
35
|
+
const txnId = action.payload.transactionId.id;
|
|
36
|
+
const reviewedFailed = response.data?.transactions_reviewed_failed ?? [];
|
|
37
|
+
const isTransactionFailed = reviewedFailed.some((t) => t.transaction_id === txnId);
|
|
38
|
+
if (!isTransactionFailed) {
|
|
39
|
+
actions.push((0, transactionReducer_1.updateTransactionIsMiscategorized)(transactionKey, false));
|
|
40
|
+
const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
41
|
+
const { transactionCategorizationView, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
42
|
+
const currentTenantId = (0, tenantSelector_1.getCurrentTenant)(state$.value)?.tenantId;
|
|
43
|
+
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
44
|
+
const selectedPeriod = currentTenantId != null
|
|
45
|
+
? selectedPeriodByTenantId[currentTenantId]
|
|
46
|
+
: undefined;
|
|
47
|
+
const autoTabLineItems = transactionCategorizationView.autoCategorized
|
|
48
|
+
.transactionReviewLocalDataById[txnId]
|
|
49
|
+
?.transactionReviewLocalData.tabSpecificLineItems
|
|
50
|
+
?.autoCategorized ?? [];
|
|
51
|
+
const hasAutoLines = autoTabLineItems.length > 0;
|
|
52
|
+
const { uiState } = transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
53
|
+
const removeIdsFromPeriod = selectedTransactionCategorizationTab === 'review'
|
|
54
|
+
? [txnId]
|
|
55
|
+
: hasAutoLines
|
|
56
|
+
? []
|
|
57
|
+
: [txnId];
|
|
58
|
+
if (selectedPeriod != null) {
|
|
59
|
+
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(selectedTransactionCategorizationTab, [txnId], removeIdsFromPeriod, selectedPeriod, 'Completed'));
|
|
60
|
+
}
|
|
61
|
+
if (!hasAutoLines) {
|
|
62
|
+
actions.push((0, transactionReducer_1.removeTransactionCategorization)({
|
|
63
|
+
transactionIds: [txnId],
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
if (removeIdsFromPeriod.length > 0 &&
|
|
67
|
+
selectedPeriod != null) {
|
|
68
|
+
const totalCountByPeriod = uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
69
|
+
const safeTotalCount = totalCountByPeriod ?? 0;
|
|
70
|
+
const updatedTotalCount = Math.max(0, safeTotalCount - 1);
|
|
71
|
+
actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
72
|
+
selectedPeriod,
|
|
73
|
+
selectedTab: selectedTransactionCategorizationTab,
|
|
74
|
+
totalCount: updatedTotalCount,
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
79
|
+
transactionId: action.payload.transactionId,
|
|
80
|
+
fetchState: 'Completed',
|
|
81
|
+
}));
|
|
82
|
+
if (action.payload.transactionSaveUpdates.anyBulkUpdates === true) {
|
|
83
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
84
|
+
messageSection: 'transactionDetails_updatingPastTransactions',
|
|
85
|
+
messageText: 'success',
|
|
86
|
+
type: 'success',
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
91
|
+
messageSection: 'transactionDetails_transactionUpdated',
|
|
92
|
+
messageText: 'success',
|
|
93
|
+
type: 'success',
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
return (0, rxjs_1.from)(actions);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return (0, rxjs_1.of)((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Error', response.status));
|
|
100
|
+
}
|
|
101
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Error', (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Transaction mark as reviewed REST API call errored out ${error}`)))));
|
|
102
|
+
}
|
|
15
103
|
return zeniAPI
|
|
16
104
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${action.payload.transactionId.id}/mark-miscategorized-as-correct`, preparePayload(action.payload.transactionId))
|
|
17
105
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -19,44 +107,7 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
19
107
|
const actions = [];
|
|
20
108
|
actions.push((0, transactionDetailReducer_1.updateStatusForTransactionNotMiscategorizedUpdate)(action.payload.transactionId, 'Completed', undefined));
|
|
21
109
|
const transactionKey = (0, transactionDetailState_1.getTransactionDetailKey)(action.payload.transactionId);
|
|
22
|
-
// Mark this transaction as not miscategorized anymore
|
|
23
110
|
actions.push((0, transactionReducer_1.updateTransactionIsMiscategorized)(transactionKey, false));
|
|
24
|
-
if (action.payload.isExpenseAutomationEnabled === true) {
|
|
25
|
-
const { expenseAutomationViewState, expenseAutomationTransactionsViewState, } = state$.value;
|
|
26
|
-
const { transactionCategorizationView, selectedTransactionCategorizationTab, } = expenseAutomationTransactionsViewState;
|
|
27
|
-
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
28
|
-
const { selectedPeriodByTenantId } = expenseAutomationViewState;
|
|
29
|
-
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
30
|
-
const txnId = action.payload.transactionId.id;
|
|
31
|
-
const autoTabLineItems = transactionCategorizationView.autoCategorized
|
|
32
|
-
.transactionReviewLocalDataById[txnId]
|
|
33
|
-
?.transactionReviewLocalData.tabSpecificLineItems
|
|
34
|
-
.autoCategorized ?? [];
|
|
35
|
-
const hasAutoLines = autoTabLineItems.length > 0;
|
|
36
|
-
const { uiState } = transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
37
|
-
const removeIdsFromPeriod = selectedTransactionCategorizationTab === 'review'
|
|
38
|
-
? [txnId]
|
|
39
|
-
: hasAutoLines
|
|
40
|
-
? []
|
|
41
|
-
: [txnId];
|
|
42
|
-
actions.push((0, transactionsViewReducer_1.updateStatusForTransactionNotMiscategorizedUpdateForCategorization)(selectedTransactionCategorizationTab, [txnId], removeIdsFromPeriod, selectedPeriod, 'Completed'));
|
|
43
|
-
if (!hasAutoLines) {
|
|
44
|
-
actions.push((0, transactionReducer_1.removeTransactionCategorization)({
|
|
45
|
-
transactionIds: [txnId],
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
if (removeIdsFromPeriod.length > 0) {
|
|
49
|
-
const totalCountByPeriod = uiState.totalCount[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)];
|
|
50
|
-
const updatedTotalCount = totalCountByPeriod === 0
|
|
51
|
-
? totalCountByPeriod
|
|
52
|
-
: totalCountByPeriod - 1;
|
|
53
|
-
actions.push((0, transactionsViewReducer_1.updateTotalCountForTransactionCategorization)({
|
|
54
|
-
selectedPeriod,
|
|
55
|
-
selectedTab: selectedTransactionCategorizationTab,
|
|
56
|
-
totalCount: updatedTotalCount,
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
111
|
actions.push((0, transactionDetailReducer_1.updateStatusConsolidatedSaveTransactionDetail)({
|
|
61
112
|
transactionId: action.payload.transactionId,
|
|
62
113
|
fetchState: 'Completed',
|
|
@@ -69,7 +120,6 @@ const markTransactionAsNotMiscategorizedEpic = (actions$, state$, zeniAPI) => ac
|
|
|
69
120
|
}));
|
|
70
121
|
}
|
|
71
122
|
else {
|
|
72
|
-
//Finally everything done for this transaction
|
|
73
123
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
74
124
|
messageSection: 'transactionDetails_transactionUpdated',
|
|
75
125
|
messageText: 'success',
|