@zeniai/client-epic-state 5.1.51-betaAK2 → 5.1.51-betaAK3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/invoicing/creditNote/creditNotePayload.d.ts +1 -0
- package/lib/entity/invoicing/creditNote/creditNotePayload.js +3 -4
- package/lib/entity/invoicing/invoice/invoicePayload.d.ts +1 -0
- package/lib/entity/invoicing/invoice/invoicePayload.js +7 -8
- package/lib/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -1
- package/lib/entity/invoicing/invoicingTransaction/invoicingTransactionPayload.d.ts +1 -0
- package/lib/entity/invoicing/invoicingTransaction/invoicingTransactionPayload.js +3 -4
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/esm/entity/invoicing/creditNote/creditNotePayload.js +3 -4
- package/lib/esm/entity/invoicing/invoice/invoicePayload.js +7 -8
- package/lib/esm/entity/invoicing/invoicingCustomer/invoicingCustomerPayload.js +1 -1
- package/lib/esm/entity/invoicing/invoicingTransaction/invoicingTransactionPayload.js +3 -4
- package/lib/esm/entity/tenant/clearAllEpic.js +2 -0
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +24 -7
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +24 -7
- package/package.json +1 -1
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingCreditNotePayloadToState = exports.mapInvoicingCreditNoteAllocationPayloadToState = exports.mapInvoicingCreditNoteLineItemPayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
7
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
8
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
9
8
|
const mapInvoicingCreditNoteLineItemPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
10
9
|
amount: (0, amount_1.toAmount)(payload.amount, currencyCode, currencySymbol),
|
|
11
10
|
description: payload.description,
|
|
@@ -22,8 +21,8 @@ const mapInvoicingCreditNoteAllocationPayloadToState = (payload, currencyCode, c
|
|
|
22
21
|
});
|
|
23
22
|
exports.mapInvoicingCreditNoteAllocationPayloadToState = mapInvoicingCreditNoteAllocationPayloadToState;
|
|
24
23
|
const mapInvoicingCreditNotePayloadToState = (payload) => {
|
|
25
|
-
const currencyCode = payload.currency_code ??
|
|
26
|
-
const currencySymbol =
|
|
24
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
25
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
27
26
|
const toAmt = (value) => (0, amount_1.toAmount)(value, currencyCode, currencySymbol);
|
|
28
27
|
return {
|
|
29
28
|
id: payload.id,
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingInvoiceKPIsPayloadToState = exports.mapInvoicingInvoicePayloadToState = exports.extractInvoicingInvoiceAddresses = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
7
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
8
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
9
8
|
const mapLineItem = (payload, currencyCode, currencySymbol) => ({
|
|
10
9
|
amount: (0, amount_1.toAmount)(payload.amount, currencyCode, currencySymbol),
|
|
11
10
|
description: payload.description,
|
|
@@ -67,8 +66,8 @@ const extractInvoicingInvoiceAddresses = (payloads) => payloads
|
|
|
67
66
|
.filter((address) => address != null);
|
|
68
67
|
exports.extractInvoicingInvoiceAddresses = extractInvoicingInvoiceAddresses;
|
|
69
68
|
const mapInvoicingInvoicePayloadToState = (payload) => {
|
|
70
|
-
const currencyCode = payload.currency_code ??
|
|
71
|
-
const currencySymbol =
|
|
69
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
70
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
72
71
|
const toAmt = (value) => (0, amount_1.toAmount)(value, currencyCode, currencySymbol);
|
|
73
72
|
return {
|
|
74
73
|
customerID: payload.customer_id,
|
|
@@ -133,9 +132,9 @@ const mapInvoicingInvoicePayloadToState = (payload) => {
|
|
|
133
132
|
};
|
|
134
133
|
exports.mapInvoicingInvoicePayloadToState = mapInvoicingInvoicePayloadToState;
|
|
135
134
|
const mapInvoicingInvoiceKPIsPayloadToState = (payload) => ({
|
|
136
|
-
dueTotal: (0, amount_1.toAmount)(payload.due_total,
|
|
137
|
-
paidTotal: (0, amount_1.toAmount)(payload.paid_total,
|
|
138
|
-
pendingTotal: (0, amount_1.toAmount)(payload.pending_total,
|
|
139
|
-
totalInvoiced: (0, amount_1.toAmount)(payload.total_invoiced,
|
|
135
|
+
dueTotal: (0, amount_1.toAmount)(payload.due_total, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
136
|
+
paidTotal: (0, amount_1.toAmount)(payload.paid_total, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
137
|
+
pendingTotal: (0, amount_1.toAmount)(payload.pending_total, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
138
|
+
totalInvoiced: (0, amount_1.toAmount)(payload.total_invoiced, currencyHelper_1.defaultCustomerCurrency.currencyCode, currencyHelper_1.defaultCustomerCurrency.currencySymbol),
|
|
140
139
|
});
|
|
141
140
|
exports.mapInvoicingInvoiceKPIsPayloadToState = mapInvoicingInvoiceKPIsPayloadToState;
|
|
@@ -24,7 +24,7 @@ const mapInvoicingCustomerPayloadToState = (payload) => {
|
|
|
24
24
|
? (0, amount_1.toAmount)(payload.arr, currencyCode, currencySymbol)
|
|
25
25
|
: undefined,
|
|
26
26
|
autoCollection: payload.auto_collection,
|
|
27
|
-
billingAddressId: payload.billing_address_id,
|
|
27
|
+
billingAddressId: payload.billing_address_id ?? payload.billing_address?.address_id,
|
|
28
28
|
cardStatus: payload.card_status,
|
|
29
29
|
company: payload.company,
|
|
30
30
|
consolidatedInvoicing: payload.consolidated_invoicing,
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapInvoicingTransactionPayloadToState = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
|
+
const currencyHelper_1 = require("../../../commonStateTypes/currencyHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
6
7
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
7
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
8
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
9
8
|
const mapLinkedInvoiceRef = (payload, currencyCode, currencySymbol) => ({
|
|
10
9
|
appliedAmount: (0, amount_1.toAmount)(payload.applied_amount, currencyCode, currencySymbol),
|
|
11
10
|
invoiceID: payload.invoice_id,
|
|
@@ -21,8 +20,8 @@ const mapLinkedCreditNoteRef = (payload, currencyCode, currencySymbol) => ({
|
|
|
21
20
|
cnID: payload.cn_id,
|
|
22
21
|
});
|
|
23
22
|
const mapInvoicingTransactionPayloadToState = (payload) => {
|
|
24
|
-
const currencyCode = payload.currency_code ??
|
|
25
|
-
const currencySymbol =
|
|
23
|
+
const currencyCode = payload.currency_code ?? currencyHelper_1.defaultCustomerCurrency.currencyCode;
|
|
24
|
+
const currencySymbol = payload.currency_symbol ?? currencyHelper_1.defaultCustomerCurrency.currencySymbol;
|
|
26
25
|
const toAmt = (value) => (0, amount_1.toAmount)(value, currencyCode, currencySymbol);
|
|
27
26
|
return {
|
|
28
27
|
amount: toAmt(payload.amount),
|
|
@@ -65,6 +65,7 @@ import { clearAllInvoicingDunningActions } from '../../view/invoicing/dunningAct
|
|
|
65
65
|
import { resetEditInvoicingCatalogItemDetailView } from '../../view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
66
66
|
import { resetEditInvoicingCouponDetailView } from '../../view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
67
67
|
import { resetEditInvoicingCustomerDetailView } from '../../view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer';
|
|
68
|
+
import { resetEditInvoicingSubscriptionDetailView } from '../../view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
68
69
|
import { clearAllInvoicingInvoiceActions } from '../../view/invoicing/invoiceAction/invoiceActionReducer';
|
|
69
70
|
import { clearAllInvoiceDetail } from '../../view/invoicing/invoiceDetail/invoiceDetailReducer';
|
|
70
71
|
import { clearInvoiceList } from '../../view/invoicing/invoiceList/invoiceListReducer';
|
|
@@ -255,7 +256,7 @@ import { clearAllUserRoles } from '../userRole/userRoleReducer';
|
|
|
255
256
|
import { clearAllVendors } from '../vendor/vendorReducer';
|
|
256
257
|
import { clearAllVendorExpenseTrends } from '../vendorExpense/vendorExpenseReducer';
|
|
257
258
|
import { clearAll } from './tenantReducer';
|
|
258
|
-
type clearActionTypeForViews = ReturnType<typeof clearAccountList> | ReturnType<typeof clearAccountMappingView> | ReturnType<typeof clearActivityHistory> | ReturnType<typeof clearActivityRealTimeApproval> | ReturnType<typeof clearAddressView> | ReturnType<typeof clearAiAccountantView> | ReturnType<typeof clearAllAiAccountantCustomers> | ReturnType<typeof clearAiCfoView> | ReturnType<typeof clearAllClasses> | ReturnType<typeof clearAllProjects> | ReturnType<typeof clearAllMonthEndCloseChecksView> | ReturnType<typeof clearApAging> | ReturnType<typeof clearApAgingDetail> | ReturnType<typeof clearArAging> | ReturnType<typeof clearArAgingDetail> | ReturnType<typeof clearAuthenticationView> | ReturnType<typeof clearAutoTransferRules> | ReturnType<typeof clearBalanceSheet> | ReturnType<typeof clearBankAccountView> | ReturnType<typeof clearBillDetailView> | ReturnType<typeof clearBillList> | ReturnType<typeof clearBillPayBulkActionView> | ReturnType<typeof clearBillPayCard> | ReturnType<typeof clearBillPayConfig> | ReturnType<typeof clearBillPayReview> | ReturnType<typeof clearBillPaySetupApproverView> | ReturnType<typeof clearBillPaySetupView> | ReturnType<typeof clearCardBalance> | ReturnType<typeof clearCardPaymentView> | ReturnType<typeof clearCardPolicyDetail> | ReturnType<typeof clearCardPolicyList> | ReturnType<typeof clearCardUserOnboarding> | ReturnType<typeof clearCashbackDetail> | ReturnType<typeof clearCashBalance> | ReturnType<typeof clearCashFlow> | ReturnType<typeof clearCashInCashOut> | ReturnType<typeof clearCashPosition> | ReturnType<typeof clearChargeCardConfig> | ReturnType<typeof clearChargeCardDetail> | ReturnType<typeof clearChargeCardList> | ReturnType<typeof clearChargeCardRepaymentDetail> | ReturnType<typeof clearChargeCardSetupView> | ReturnType<typeof clearChargeCardStatementList> | ReturnType<typeof clearCheckDeposit> | ReturnType<typeof clearCompanyConfigView> | ReturnType<typeof clearCompanyHealthMetric> | ReturnType<typeof clearCompanyHealthMetricView> | ReturnType<typeof clearCompanyMonthEndReportView> | ReturnType<typeof clearCompanyTaskManagerView> | ReturnType<typeof clearCompanyView> | ReturnType<typeof clearCreateCardPolicy> | ReturnType<typeof clearCreateTransferEntry> | ReturnType<typeof clearAllCreditAgent> | ReturnType<typeof clearCreditAgentView> | ReturnType<typeof clearDashboard> | ReturnType<typeof clearDashboardLayout> | ReturnType<typeof clearDepositAccountDetail> | ReturnType<typeof clearDepositAccountList> | ReturnType<typeof clearDepositAccountTransactionList> | ReturnType<typeof clearEditBillViewDetail> | ReturnType<typeof clearEditRemiViewDetail> | ReturnType<typeof clearAllEntityAutoCompleteResults> | ReturnType<typeof clearExpenseAutomationFluxAnalysisView> | ReturnType<typeof clearExpenseAutomationJESchedulesView> | ReturnType<typeof clearExpenseAutomationMissingReceiptsView> | ReturnType<typeof clearExpenseAutomationReconciliationView> | ReturnType<typeof clearExpenseAutomationTransactionsView> | ReturnType<typeof clearExpenseAutomationView> | ReturnType<typeof clearExpressPayView> | ReturnType<typeof clearFeatureNotificationView> | ReturnType<typeof clearFileViewList> | ReturnType<typeof clearFinanceStatement> | ReturnType<typeof clearForecastList> | ReturnType<typeof clearGlobalMerchantAutoCompleteResults> | ReturnType<typeof clearGlobalMerchantView> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof clearInternationalWire> | ReturnType<typeof clearInternationalVerificationView> | ReturnType<typeof clearAllInvoiceDetail> | ReturnType<typeof clearInvoiceList> | ReturnType<typeof resetCreateInvoice> | ReturnType<typeof resetRecordPayment> | ReturnType<typeof clearInvoicingOverview> | ReturnType<typeof clearInvoicingAuditView> | ReturnType<typeof resetEditInvoicingCatalogItemDetailView> | ReturnType<typeof resetEditInvoicingCouponDetailView> | ReturnType<typeof clearInvoicingCouponDetailView> | ReturnType<typeof resetEditInvoicingCustomerDetailView> | ReturnType<typeof clearAllInvoicingDataImportActions> | ReturnType<typeof clearInvoicingDataImportView> | ReturnType<typeof clearAllInvoicingInvoiceActions> | ReturnType<typeof clearAllInvoicingSubscriptionActions> | ReturnType<typeof clearAllInvoicingDunningActions> | ReturnType<typeof clearAllInvoicingPaymentActions> | ReturnType<typeof resetSaveInvoicingSettings> | ReturnType<typeof clearInvoicingCatalogItemDetailView> | ReturnType<typeof clearInvoicingCatalogListView> | ReturnType<typeof clearInvoicingCouponView> | ReturnType<typeof clearInvoicingCreditNoteDetailView> | ReturnType<typeof clearInvoicingCreditNoteListView> | ReturnType<typeof clearInvoicingCustomerDetailView> | ReturnType<typeof clearInvoicingCustomerListView> | ReturnType<typeof clearInvoicingDunningCaseDetailView> | ReturnType<typeof clearInvoicingDunningCaseListView> | ReturnType<typeof clearInvoicingOnboarding> | ReturnType<typeof clearInvoicingSettings> | ReturnType<typeof clearInvoicingSubscriptionDetailView> | ReturnType<typeof clearInvoicingSubscriptionListView> | ReturnType<typeof clearInvoicingTransactionDetailView> | ReturnType<typeof clearInvoicingTransactionListView> | ReturnType<typeof clearIssueChargeCard> | ReturnType<typeof clearMerchantList> | ReturnType<typeof clearNetBurnOrIncome> | ReturnType<typeof clearNetBurnOrIncomeClassesView> | ReturnType<typeof clearNetBurnOrIncomeStoryCard> | ReturnType<typeof clearNotificationView> | ReturnType<typeof clearOnboardingCockpitView> | ReturnType<typeof clearOnboardingCustomerView> | ReturnType<typeof clearOpEx> | ReturnType<typeof clearOpExByVendor> | ReturnType<typeof clearOpExClassesView> | ReturnType<typeof clearOwnerList> | ReturnType<typeof clearPaymentAccountList> | ReturnType<typeof clearPeople> | ReturnType<typeof clearAggregatedReport> | ReturnType<typeof clearPreviousBills> | ReturnType<typeof clearProfitAndLoss> | ReturnType<typeof clearProfitAndLossClassesView> | ReturnType<typeof clearProfitAndLossProjectView> | ReturnType<typeof clearProjectList> | ReturnType<typeof clearRecommendation> | ReturnType<typeof clearReferrals> | ReturnType<typeof clearReimbursementCard> | ReturnType<typeof clearReimbursementConfig> | ReturnType<typeof clearRemiBulkActionView> | ReturnType<typeof clearRemiDetailView> | ReturnType<typeof clearRemiList> | ReturnType<typeof clearRemiSetupApproverView> | ReturnType<typeof clearRemiSetupView> | ReturnType<typeof clearReportUIOption> | ReturnType<typeof clearRevenue> | ReturnType<typeof clearRevenueClassesView> | ReturnType<typeof clearReviewCompany> | ReturnType<typeof clearScheduleDetailView> | ReturnType<typeof clearScheduleAccruedDetailView> | ReturnType<typeof clearScheduleList> | ReturnType<typeof clearSettingsView> | ReturnType<typeof clearSetupView> | ReturnType<typeof clearPlaidAccountView> | ReturnType<typeof clearSubscriptionView> | ReturnType<typeof clearTagView> | ReturnType<typeof clearTaskDetail> | ReturnType<typeof clearTaskGroupTemplatesView> | ReturnType<typeof clearTaskGroupView> | ReturnType<typeof clearTaskList> | ReturnType<typeof clearTasksCard> | ReturnType<typeof clearTopEx> | ReturnType<typeof clearTransactionDetail> | ReturnType<typeof clearTransactionList> | ReturnType<typeof clearTransferDetail> | ReturnType<typeof clearTreasuryOverviewDetail> | ReturnType<typeof clearTreasurySetupView> | ReturnType<typeof clearTreasuryStatementList> | ReturnType<typeof clearTreasuryTaxLetterList> | ReturnType<typeof clearTreasuryTransferMoney> | ReturnType<typeof clearTrendData> | ReturnType<typeof clearTrendWithTransactions> | ReturnType<typeof clearTwoFactorAuthentication> | ReturnType<typeof clearUserFinancialAccount> | ReturnType<typeof clearUserListView> | ReturnType<typeof clearUserRoleConfigView> | ReturnType<typeof clearVendorGlobalReviewView> | ReturnType<typeof clearVendorReviewView> | ReturnType<typeof clearVendorTypeList> | ReturnType<typeof clearVendor1099TypeList> | ReturnType<typeof clearVendorView> | ReturnType<typeof clearVendorsFiling1099List> | ReturnType<typeof clearVendorsList> | ReturnType<typeof clearVendorsTabVendorView> | ReturnType<typeof clearWiseRedirectStatus> | ReturnType<typeof clearZeniAccStatementList> | ReturnType<typeof clearZeniAccountList> | ReturnType<typeof clearZeniAccountSetupView> | ReturnType<typeof clearZeniAccountsConfig> | ReturnType<typeof clearZeniAccountsPromoCard> | ReturnType<typeof clearZeniOAuthView>;
|
|
259
|
+
type clearActionTypeForViews = ReturnType<typeof clearAccountList> | ReturnType<typeof clearAccountMappingView> | ReturnType<typeof clearActivityHistory> | ReturnType<typeof clearActivityRealTimeApproval> | ReturnType<typeof clearAddressView> | ReturnType<typeof clearAiAccountantView> | ReturnType<typeof clearAllAiAccountantCustomers> | ReturnType<typeof clearAiCfoView> | ReturnType<typeof clearAllClasses> | ReturnType<typeof clearAllProjects> | ReturnType<typeof clearAllMonthEndCloseChecksView> | ReturnType<typeof clearApAging> | ReturnType<typeof clearApAgingDetail> | ReturnType<typeof clearArAging> | ReturnType<typeof clearArAgingDetail> | ReturnType<typeof clearAuthenticationView> | ReturnType<typeof clearAutoTransferRules> | ReturnType<typeof clearBalanceSheet> | ReturnType<typeof clearBankAccountView> | ReturnType<typeof clearBillDetailView> | ReturnType<typeof clearBillList> | ReturnType<typeof clearBillPayBulkActionView> | ReturnType<typeof clearBillPayCard> | ReturnType<typeof clearBillPayConfig> | ReturnType<typeof clearBillPayReview> | ReturnType<typeof clearBillPaySetupApproverView> | ReturnType<typeof clearBillPaySetupView> | ReturnType<typeof clearCardBalance> | ReturnType<typeof clearCardPaymentView> | ReturnType<typeof clearCardPolicyDetail> | ReturnType<typeof clearCardPolicyList> | ReturnType<typeof clearCardUserOnboarding> | ReturnType<typeof clearCashbackDetail> | ReturnType<typeof clearCashBalance> | ReturnType<typeof clearCashFlow> | ReturnType<typeof clearCashInCashOut> | ReturnType<typeof clearCashPosition> | ReturnType<typeof clearChargeCardConfig> | ReturnType<typeof clearChargeCardDetail> | ReturnType<typeof clearChargeCardList> | ReturnType<typeof clearChargeCardRepaymentDetail> | ReturnType<typeof clearChargeCardSetupView> | ReturnType<typeof clearChargeCardStatementList> | ReturnType<typeof clearCheckDeposit> | ReturnType<typeof clearCompanyConfigView> | ReturnType<typeof clearCompanyHealthMetric> | ReturnType<typeof clearCompanyHealthMetricView> | ReturnType<typeof clearCompanyMonthEndReportView> | ReturnType<typeof clearCompanyTaskManagerView> | ReturnType<typeof clearCompanyView> | ReturnType<typeof clearCreateCardPolicy> | ReturnType<typeof clearCreateTransferEntry> | ReturnType<typeof clearAllCreditAgent> | ReturnType<typeof clearCreditAgentView> | ReturnType<typeof clearDashboard> | ReturnType<typeof clearDashboardLayout> | ReturnType<typeof clearDepositAccountDetail> | ReturnType<typeof clearDepositAccountList> | ReturnType<typeof clearDepositAccountTransactionList> | ReturnType<typeof clearEditBillViewDetail> | ReturnType<typeof clearEditRemiViewDetail> | ReturnType<typeof clearAllEntityAutoCompleteResults> | ReturnType<typeof clearExpenseAutomationFluxAnalysisView> | ReturnType<typeof clearExpenseAutomationJESchedulesView> | ReturnType<typeof clearExpenseAutomationMissingReceiptsView> | ReturnType<typeof clearExpenseAutomationReconciliationView> | ReturnType<typeof clearExpenseAutomationTransactionsView> | ReturnType<typeof clearExpenseAutomationView> | ReturnType<typeof clearExpressPayView> | ReturnType<typeof clearFeatureNotificationView> | ReturnType<typeof clearFileViewList> | ReturnType<typeof clearFinanceStatement> | ReturnType<typeof clearForecastList> | ReturnType<typeof clearGlobalMerchantAutoCompleteResults> | ReturnType<typeof clearGlobalMerchantView> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof clearInternationalWire> | ReturnType<typeof clearInternationalVerificationView> | ReturnType<typeof clearAllInvoiceDetail> | ReturnType<typeof clearInvoiceList> | ReturnType<typeof resetCreateInvoice> | ReturnType<typeof resetRecordPayment> | ReturnType<typeof clearInvoicingOverview> | ReturnType<typeof clearInvoicingAuditView> | ReturnType<typeof resetEditInvoicingCatalogItemDetailView> | ReturnType<typeof resetEditInvoicingCouponDetailView> | ReturnType<typeof clearInvoicingCouponDetailView> | ReturnType<typeof resetEditInvoicingCustomerDetailView> | ReturnType<typeof resetEditInvoicingSubscriptionDetailView> | ReturnType<typeof clearAllInvoicingDataImportActions> | ReturnType<typeof clearInvoicingDataImportView> | ReturnType<typeof clearAllInvoicingInvoiceActions> | ReturnType<typeof clearAllInvoicingSubscriptionActions> | ReturnType<typeof clearAllInvoicingDunningActions> | ReturnType<typeof clearAllInvoicingPaymentActions> | ReturnType<typeof resetSaveInvoicingSettings> | ReturnType<typeof clearInvoicingCatalogItemDetailView> | ReturnType<typeof clearInvoicingCatalogListView> | ReturnType<typeof clearInvoicingCouponView> | ReturnType<typeof clearInvoicingCreditNoteDetailView> | ReturnType<typeof clearInvoicingCreditNoteListView> | ReturnType<typeof clearInvoicingCustomerDetailView> | ReturnType<typeof clearInvoicingCustomerListView> | ReturnType<typeof clearInvoicingDunningCaseDetailView> | ReturnType<typeof clearInvoicingDunningCaseListView> | ReturnType<typeof clearInvoicingOnboarding> | ReturnType<typeof clearInvoicingSettings> | ReturnType<typeof clearInvoicingSubscriptionDetailView> | ReturnType<typeof clearInvoicingSubscriptionListView> | ReturnType<typeof clearInvoicingTransactionDetailView> | ReturnType<typeof clearInvoicingTransactionListView> | ReturnType<typeof clearIssueChargeCard> | ReturnType<typeof clearMerchantList> | ReturnType<typeof clearNetBurnOrIncome> | ReturnType<typeof clearNetBurnOrIncomeClassesView> | ReturnType<typeof clearNetBurnOrIncomeStoryCard> | ReturnType<typeof clearNotificationView> | ReturnType<typeof clearOnboardingCockpitView> | ReturnType<typeof clearOnboardingCustomerView> | ReturnType<typeof clearOpEx> | ReturnType<typeof clearOpExByVendor> | ReturnType<typeof clearOpExClassesView> | ReturnType<typeof clearOwnerList> | ReturnType<typeof clearPaymentAccountList> | ReturnType<typeof clearPeople> | ReturnType<typeof clearAggregatedReport> | ReturnType<typeof clearPreviousBills> | ReturnType<typeof clearProfitAndLoss> | ReturnType<typeof clearProfitAndLossClassesView> | ReturnType<typeof clearProfitAndLossProjectView> | ReturnType<typeof clearProjectList> | ReturnType<typeof clearRecommendation> | ReturnType<typeof clearReferrals> | ReturnType<typeof clearReimbursementCard> | ReturnType<typeof clearReimbursementConfig> | ReturnType<typeof clearRemiBulkActionView> | ReturnType<typeof clearRemiDetailView> | ReturnType<typeof clearRemiList> | ReturnType<typeof clearRemiSetupApproverView> | ReturnType<typeof clearRemiSetupView> | ReturnType<typeof clearReportUIOption> | ReturnType<typeof clearRevenue> | ReturnType<typeof clearRevenueClassesView> | ReturnType<typeof clearReviewCompany> | ReturnType<typeof clearScheduleDetailView> | ReturnType<typeof clearScheduleAccruedDetailView> | ReturnType<typeof clearScheduleList> | ReturnType<typeof clearSettingsView> | ReturnType<typeof clearSetupView> | ReturnType<typeof clearPlaidAccountView> | ReturnType<typeof clearSubscriptionView> | ReturnType<typeof clearTagView> | ReturnType<typeof clearTaskDetail> | ReturnType<typeof clearTaskGroupTemplatesView> | ReturnType<typeof clearTaskGroupView> | ReturnType<typeof clearTaskList> | ReturnType<typeof clearTasksCard> | ReturnType<typeof clearTopEx> | ReturnType<typeof clearTransactionDetail> | ReturnType<typeof clearTransactionList> | ReturnType<typeof clearTransferDetail> | ReturnType<typeof clearTreasuryOverviewDetail> | ReturnType<typeof clearTreasurySetupView> | ReturnType<typeof clearTreasuryStatementList> | ReturnType<typeof clearTreasuryTaxLetterList> | ReturnType<typeof clearTreasuryTransferMoney> | ReturnType<typeof clearTrendData> | ReturnType<typeof clearTrendWithTransactions> | ReturnType<typeof clearTwoFactorAuthentication> | ReturnType<typeof clearUserFinancialAccount> | ReturnType<typeof clearUserListView> | ReturnType<typeof clearUserRoleConfigView> | ReturnType<typeof clearVendorGlobalReviewView> | ReturnType<typeof clearVendorReviewView> | ReturnType<typeof clearVendorTypeList> | ReturnType<typeof clearVendor1099TypeList> | ReturnType<typeof clearVendorView> | ReturnType<typeof clearVendorsFiling1099List> | ReturnType<typeof clearVendorsList> | ReturnType<typeof clearVendorsTabVendorView> | ReturnType<typeof clearWiseRedirectStatus> | ReturnType<typeof clearZeniAccStatementList> | ReturnType<typeof clearZeniAccountList> | ReturnType<typeof clearZeniAccountSetupView> | ReturnType<typeof clearZeniAccountsConfig> | ReturnType<typeof clearZeniAccountsPromoCard> | ReturnType<typeof clearZeniOAuthView>;
|
|
259
260
|
type clearActionTypeForEntities = ReturnType<typeof clearAiCfo> | ReturnType<typeof clearAllAccountGroups> | ReturnType<typeof clearAllAccountRecon> | ReturnType<typeof clearAllAccountingSummary> | ReturnType<typeof clearAllAccounts> | ReturnType<typeof clearAllAddresses> | ReturnType<typeof clearAllApprovalRules> | ReturnType<typeof clearAllBankAccounts> | ReturnType<typeof clearAllBillTransactions> | ReturnType<typeof clearAllCardPayments> | ReturnType<typeof clearAllChargeCardRepayments> | ReturnType<typeof clearAllChargeCardTransactions> | ReturnType<typeof clearAllChargeCards> | ReturnType<typeof clearAllCompanies> | ReturnType<typeof clearAllConnectedAccounts> | ReturnType<typeof clearAllCurrencies> | ReturnType<typeof clearAllCustomerIncomeTrend> | ReturnType<typeof clearAllCustomers> | ReturnType<typeof clearAllDepositAccounts> | ReturnType<typeof clearAllEntities> | ReturnType<typeof clearAllEntityApprovalStatus> | ReturnType<typeof clearAllFiles> | ReturnType<typeof clearAllForecasts> | ReturnType<typeof clearAllGlobalMerchants> | ReturnType<typeof clearAllInsights> | ReturnType<typeof clearAllInvoices> | ReturnType<typeof clearAllInvoicingCoupons> | ReturnType<typeof clearAllInvoicingCreditNotes> | ReturnType<typeof clearAllInvoicingCustomers> | ReturnType<typeof clearAllInvoicingDunningCases> | ReturnType<typeof clearAllInvoicingPlans> | ReturnType<typeof clearAllInvoicingProducts> | ReturnType<typeof clearAllInvoicingSubscriptions> | ReturnType<typeof clearAllInvoicingTransactions> | ReturnType<typeof clearAllAccruedJESchedules> | ReturnType<typeof clearAllJEScheduleTransactions> | ReturnType<typeof clearAllMerchants> | ReturnType<typeof clearAllMonthEndCloseChecks> | ReturnType<typeof clearAllNotifications> | ReturnType<typeof clearAllOnboardingCustomersInfo> | ReturnType<typeof clearAllPaymentAccounts> | ReturnType<typeof clearAllPaymentInstruments> | ReturnType<typeof clearAllRecurringBills> | ReturnType<typeof clearAllReimbursements> | ReturnType<typeof clearAllSectionsAccountsView> | ReturnType<typeof clearAllSectionsClassesViewV2> | ReturnType<typeof clearAllSectionsProjectView> | ReturnType<typeof clearAllSubscriptionAddOns> | ReturnType<typeof clearAllSubscriptionCoupons> | ReturnType<typeof clearAllSubscriptionPlans> | ReturnType<typeof clearAllSubscriptionSummary> | ReturnType<typeof clearAllSubscriptions> | ReturnType<typeof clearAllTags> | ReturnType<typeof clearAllTaskGroups> | ReturnType<typeof clearAllTaskGroupTemplates> | ReturnType<typeof clearAllTaskSummary> | ReturnType<typeof clearAllTasks> | ReturnType<typeof clearAllToastNotifications> | ReturnType<typeof clearAllTransactions> | ReturnType<typeof clearAllUserRoles> | ReturnType<typeof clearAllUsers> | ReturnType<typeof clearAllVendorExpenseTrends> | ReturnType<typeof clearAllVendors> | ReturnType<typeof clearCannedResponses> | ReturnType<typeof clearCardPolicy> | ReturnType<typeof clearClassList> | ReturnType<typeof clearContacts> | ReturnType<typeof clearCountryList> | ReturnType<typeof clearDepositAccountTransaction> | ReturnType<typeof clearSnackbar>;
|
|
260
261
|
export type ActionType = clearActionTypeForViews | clearActionTypeForEntities | ReturnType<typeof clearAll>;
|
|
261
262
|
export declare const clearAllEpic: (actions$: ActionsObservable<ActionType>) => import("rxjs").Observable<ActionType>;
|
|
@@ -69,6 +69,7 @@ const dunningActionReducer_1 = require("../../view/invoicing/dunningAction/dunni
|
|
|
69
69
|
const editInvoicingCatalogItemDetailViewReducer_1 = require("../../view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer");
|
|
70
70
|
const editInvoicingCouponDetailViewReducer_1 = require("../../view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer");
|
|
71
71
|
const editInvoicingCustomerDetailViewReducer_1 = require("../../view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer");
|
|
72
|
+
const editInvoicingSubscriptionDetailViewReducer_1 = require("../../view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer");
|
|
72
73
|
const invoiceActionReducer_1 = require("../../view/invoicing/invoiceAction/invoiceActionReducer");
|
|
73
74
|
const invoiceDetailReducer_1 = require("../../view/invoicing/invoiceDetail/invoiceDetailReducer");
|
|
74
75
|
const invoiceListReducer_1 = require("../../view/invoicing/invoiceList/invoiceListReducer");
|
|
@@ -349,6 +350,7 @@ const clearAllEpic = (actions$) => actions$.pipe((0, operators_1.filter)(tenantR
|
|
|
349
350
|
(0, editInvoicingCouponDetailViewReducer_1.resetEditInvoicingCouponDetailView)(),
|
|
350
351
|
(0, invoicingCouponDetailViewReducer_1.clearInvoicingCouponDetailView)(),
|
|
351
352
|
(0, editInvoicingCustomerDetailViewReducer_1.resetEditInvoicingCustomerDetailView)(),
|
|
353
|
+
(0, editInvoicingSubscriptionDetailViewReducer_1.resetEditInvoicingSubscriptionDetailView)(),
|
|
352
354
|
(0, dataImportActionReducer_1.clearAllInvoicingDataImportActions)(),
|
|
353
355
|
(0, dataImportViewReducer_1.clearInvoicingDataImportView)(),
|
|
354
356
|
(0, invoiceActionReducer_1.clearAllInvoicingInvoiceActions)(),
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
4
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
5
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
6
5
|
export const mapInvoicingCreditNoteLineItemPayloadToState = (payload, currencyCode, currencySymbol) => ({
|
|
7
6
|
amount: toAmount(payload.amount, currencyCode, currencySymbol),
|
|
8
7
|
description: payload.description,
|
|
@@ -17,8 +16,8 @@ export const mapInvoicingCreditNoteAllocationPayloadToState = (payload, currency
|
|
|
17
16
|
allocatedAt: payload.allocated_at != null ? date(payload.allocated_at) : undefined,
|
|
18
17
|
});
|
|
19
18
|
export const mapInvoicingCreditNotePayloadToState = (payload) => {
|
|
20
|
-
const currencyCode = payload.currency_code ??
|
|
21
|
-
const currencySymbol =
|
|
19
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
20
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
22
21
|
const toAmt = (value) => toAmount(value, currencyCode, currencySymbol);
|
|
23
22
|
return {
|
|
24
23
|
id: payload.id,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
4
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
5
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
6
5
|
const mapLineItem = (payload, currencyCode, currencySymbol) => ({
|
|
7
6
|
amount: toAmount(payload.amount, currencyCode, currencySymbol),
|
|
8
7
|
description: payload.description,
|
|
@@ -63,8 +62,8 @@ export const extractInvoicingInvoiceAddresses = (payloads) => payloads
|
|
|
63
62
|
.flatMap((payload) => [payload.billing_address, payload.shipping_address])
|
|
64
63
|
.filter((address) => address != null);
|
|
65
64
|
export const mapInvoicingInvoicePayloadToState = (payload) => {
|
|
66
|
-
const currencyCode = payload.currency_code ??
|
|
67
|
-
const currencySymbol =
|
|
65
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
66
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
68
67
|
const toAmt = (value) => toAmount(value, currencyCode, currencySymbol);
|
|
69
68
|
return {
|
|
70
69
|
customerID: payload.customer_id,
|
|
@@ -128,8 +127,8 @@ export const mapInvoicingInvoicePayloadToState = (payload) => {
|
|
|
128
127
|
};
|
|
129
128
|
};
|
|
130
129
|
export const mapInvoicingInvoiceKPIsPayloadToState = (payload) => ({
|
|
131
|
-
dueTotal: toAmount(payload.due_total,
|
|
132
|
-
paidTotal: toAmount(payload.paid_total,
|
|
133
|
-
pendingTotal: toAmount(payload.pending_total,
|
|
134
|
-
totalInvoiced: toAmount(payload.total_invoiced,
|
|
130
|
+
dueTotal: toAmount(payload.due_total, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
131
|
+
paidTotal: toAmount(payload.paid_total, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
132
|
+
pendingTotal: toAmount(payload.pending_total, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
133
|
+
totalInvoiced: toAmount(payload.total_invoiced, defaultCustomerCurrency.currencyCode, defaultCustomerCurrency.currencySymbol),
|
|
135
134
|
});
|
|
@@ -20,7 +20,7 @@ export const mapInvoicingCustomerPayloadToState = (payload) => {
|
|
|
20
20
|
? toAmount(payload.arr, currencyCode, currencySymbol)
|
|
21
21
|
: undefined,
|
|
22
22
|
autoCollection: payload.auto_collection,
|
|
23
|
-
billingAddressId: payload.billing_address_id,
|
|
23
|
+
billingAddressId: payload.billing_address_id ?? payload.billing_address?.address_id,
|
|
24
24
|
cardStatus: payload.card_status,
|
|
25
25
|
company: payload.company,
|
|
26
26
|
consolidatedInvoicing: payload.consolidated_invoicing,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { toAmount } from '../../../commonStateTypes/amount';
|
|
2
|
+
import { defaultCustomerCurrency } from '../../../commonStateTypes/currencyHelper';
|
|
2
3
|
import { date } from '../../../zeniDayJS';
|
|
3
4
|
// ── Payload → State mappers (snake_case wire shape → camelCase domain shape) ──
|
|
4
|
-
const DEFAULT_CURRENCY_CODE = 'USD';
|
|
5
|
-
const DEFAULT_CURRENCY_SYMBOL = '$';
|
|
6
5
|
const mapLinkedInvoiceRef = (payload, currencyCode, currencySymbol) => ({
|
|
7
6
|
appliedAmount: toAmount(payload.applied_amount, currencyCode, currencySymbol),
|
|
8
7
|
invoiceID: payload.invoice_id,
|
|
@@ -18,8 +17,8 @@ const mapLinkedCreditNoteRef = (payload, currencyCode, currencySymbol) => ({
|
|
|
18
17
|
cnID: payload.cn_id,
|
|
19
18
|
});
|
|
20
19
|
export const mapInvoicingTransactionPayloadToState = (payload) => {
|
|
21
|
-
const currencyCode = payload.currency_code ??
|
|
22
|
-
const currencySymbol =
|
|
20
|
+
const currencyCode = payload.currency_code ?? defaultCustomerCurrency.currencyCode;
|
|
21
|
+
const currencySymbol = payload.currency_symbol ?? defaultCustomerCurrency.currencySymbol;
|
|
23
22
|
const toAmt = (value) => toAmount(value, currencyCode, currencySymbol);
|
|
24
23
|
return {
|
|
25
24
|
amount: toAmt(payload.amount),
|
|
@@ -66,6 +66,7 @@ import { clearAllInvoicingDunningActions } from '../../view/invoicing/dunningAct
|
|
|
66
66
|
import { resetEditInvoicingCatalogItemDetailView } from '../../view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
67
67
|
import { resetEditInvoicingCouponDetailView } from '../../view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
68
68
|
import { resetEditInvoicingCustomerDetailView } from '../../view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewReducer';
|
|
69
|
+
import { resetEditInvoicingSubscriptionDetailView } from '../../view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
69
70
|
import { clearAllInvoicingInvoiceActions } from '../../view/invoicing/invoiceAction/invoiceActionReducer';
|
|
70
71
|
import { clearAllInvoiceDetail } from '../../view/invoicing/invoiceDetail/invoiceDetailReducer';
|
|
71
72
|
import { clearInvoiceList } from '../../view/invoicing/invoiceList/invoiceListReducer';
|
|
@@ -346,6 +347,7 @@ export const clearAllEpic = (actions$) => actions$.pipe(filter(clearAll.match),
|
|
|
346
347
|
resetEditInvoicingCouponDetailView(),
|
|
347
348
|
clearInvoicingCouponDetailView(),
|
|
348
349
|
resetEditInvoicingCustomerDetailView(),
|
|
350
|
+
resetEditInvoicingSubscriptionDetailView(),
|
|
349
351
|
clearAllInvoicingDataImportActions(),
|
|
350
352
|
clearInvoicingDataImportView(),
|
|
351
353
|
clearAllInvoicingInvoiceActions(),
|
|
@@ -788,13 +788,23 @@ export default expenseAutomationReconciliationView.reducer;
|
|
|
788
788
|
function isEntityStatementParsing(reconciliation) {
|
|
789
789
|
return reconciliation.statement_data_status?.code === 'parsing';
|
|
790
790
|
}
|
|
791
|
+
/** Entity no longer in an active parse — client latch should clear. */
|
|
792
|
+
function isEntityStatementParseTerminal(reconciliation) {
|
|
793
|
+
const statusCode = reconciliation.statement_data_status?.code;
|
|
794
|
+
return (statusCode === 'processed' ||
|
|
795
|
+
statusCode === 'validated' ||
|
|
796
|
+
statusCode === 'parsing_failed' ||
|
|
797
|
+
statusCode === 'validation_failed' ||
|
|
798
|
+
statusCode === 'processing_failed' ||
|
|
799
|
+
statusCode === 'deleting' ||
|
|
800
|
+
statusCode === 'deleted');
|
|
801
|
+
}
|
|
791
802
|
function resolveStatementParseInProgressAfterFetch(oldRecord, reconciliation) {
|
|
792
803
|
if (isEntityStatementParsing(reconciliation)) {
|
|
793
804
|
return true;
|
|
794
805
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
}
|
|
806
|
+
// Keep latch while client upload/parse/reparse is actively in flight, even if
|
|
807
|
+
// entity already looks terminal (e.g. V3 parseStatement GET still loading).
|
|
798
808
|
if (oldRecord?.statementParseStatus.fetchState === 'In-Progress') {
|
|
799
809
|
return true;
|
|
800
810
|
}
|
|
@@ -804,12 +814,21 @@ function resolveStatementParseInProgressAfterFetch(oldRecord, reconciliation) {
|
|
|
804
814
|
if (oldRecord?.statementUploadStatus.fetchState === 'In-Progress') {
|
|
805
815
|
return true;
|
|
806
816
|
}
|
|
807
|
-
// Reparse POST returned; async parse may not be on entity yet
|
|
817
|
+
// Reparse POST returned; async parse may not be on entity yet (entity can
|
|
818
|
+
// still show the previous processed status).
|
|
808
819
|
if (oldRecord?.reparseStatementStatus.fetchState === 'Completed' &&
|
|
809
820
|
oldRecord.statementParseStatus.fetchState !== 'Completed' &&
|
|
810
821
|
oldRecord.statementParseStatus.fetchState !== 'Error') {
|
|
811
822
|
return true;
|
|
812
823
|
}
|
|
824
|
+
// Entity reports parse finished and no client request is in flight — clear
|
|
825
|
+
// sticky latch. Critical for V1 (no parseStatement) after Pusher refresh.
|
|
826
|
+
if (isEntityStatementParseTerminal(reconciliation)) {
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
829
|
+
if (oldRecord?.statementParseInProgress === true) {
|
|
830
|
+
return true;
|
|
831
|
+
}
|
|
813
832
|
// Continue-in-background while parse flow has not finished.
|
|
814
833
|
if (oldRecord?.statementProcessingDismissedToBackground === true &&
|
|
815
834
|
oldRecord.statementParseStatus.fetchState !== 'Completed' &&
|
|
@@ -951,9 +970,7 @@ function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accoun
|
|
|
951
970
|
: false,
|
|
952
971
|
paymentAccountId: accounts.payment_account_id ?? undefined,
|
|
953
972
|
};
|
|
954
|
-
const
|
|
955
|
-
const statementParseInProgress = reconciliationData.bank_status.code === 'parsing' ||
|
|
956
|
-
oldStatementParseInProgress === true;
|
|
973
|
+
const statementParseInProgress = resolveStatementParseInProgressAfterFetch(oldRecord, reconciliationData);
|
|
957
974
|
if (refreshViewInBackground === true) {
|
|
958
975
|
draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)].reconciliationByAccountID[accountId] = {
|
|
959
976
|
...oldRecord,
|
|
@@ -793,13 +793,23 @@ exports.default = expenseAutomationReconciliationView.reducer;
|
|
|
793
793
|
function isEntityStatementParsing(reconciliation) {
|
|
794
794
|
return reconciliation.statement_data_status?.code === 'parsing';
|
|
795
795
|
}
|
|
796
|
+
/** Entity no longer in an active parse — client latch should clear. */
|
|
797
|
+
function isEntityStatementParseTerminal(reconciliation) {
|
|
798
|
+
const statusCode = reconciliation.statement_data_status?.code;
|
|
799
|
+
return (statusCode === 'processed' ||
|
|
800
|
+
statusCode === 'validated' ||
|
|
801
|
+
statusCode === 'parsing_failed' ||
|
|
802
|
+
statusCode === 'validation_failed' ||
|
|
803
|
+
statusCode === 'processing_failed' ||
|
|
804
|
+
statusCode === 'deleting' ||
|
|
805
|
+
statusCode === 'deleted');
|
|
806
|
+
}
|
|
796
807
|
function resolveStatementParseInProgressAfterFetch(oldRecord, reconciliation) {
|
|
797
808
|
if (isEntityStatementParsing(reconciliation)) {
|
|
798
809
|
return true;
|
|
799
810
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}
|
|
811
|
+
// Keep latch while client upload/parse/reparse is actively in flight, even if
|
|
812
|
+
// entity already looks terminal (e.g. V3 parseStatement GET still loading).
|
|
803
813
|
if (oldRecord?.statementParseStatus.fetchState === 'In-Progress') {
|
|
804
814
|
return true;
|
|
805
815
|
}
|
|
@@ -809,12 +819,21 @@ function resolveStatementParseInProgressAfterFetch(oldRecord, reconciliation) {
|
|
|
809
819
|
if (oldRecord?.statementUploadStatus.fetchState === 'In-Progress') {
|
|
810
820
|
return true;
|
|
811
821
|
}
|
|
812
|
-
// Reparse POST returned; async parse may not be on entity yet
|
|
822
|
+
// Reparse POST returned; async parse may not be on entity yet (entity can
|
|
823
|
+
// still show the previous processed status).
|
|
813
824
|
if (oldRecord?.reparseStatementStatus.fetchState === 'Completed' &&
|
|
814
825
|
oldRecord.statementParseStatus.fetchState !== 'Completed' &&
|
|
815
826
|
oldRecord.statementParseStatus.fetchState !== 'Error') {
|
|
816
827
|
return true;
|
|
817
828
|
}
|
|
829
|
+
// Entity reports parse finished and no client request is in flight — clear
|
|
830
|
+
// sticky latch. Critical for V1 (no parseStatement) after Pusher refresh.
|
|
831
|
+
if (isEntityStatementParseTerminal(reconciliation)) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
if (oldRecord?.statementParseInProgress === true) {
|
|
835
|
+
return true;
|
|
836
|
+
}
|
|
818
837
|
// Continue-in-background while parse flow has not finished.
|
|
819
838
|
if (oldRecord?.statementProcessingDismissedToBackground === true &&
|
|
820
839
|
oldRecord.statementParseStatus.fetchState !== 'Completed' &&
|
|
@@ -956,9 +975,7 @@ function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accoun
|
|
|
956
975
|
: false,
|
|
957
976
|
paymentAccountId: accounts.payment_account_id ?? undefined,
|
|
958
977
|
};
|
|
959
|
-
const
|
|
960
|
-
const statementParseInProgress = reconciliationData.bank_status.code === 'parsing' ||
|
|
961
|
-
oldStatementParseInProgress === true;
|
|
978
|
+
const statementParseInProgress = resolveStatementParseInProgressAfterFetch(oldRecord, reconciliationData);
|
|
962
979
|
if (refreshViewInBackground === true) {
|
|
963
980
|
draft.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)].reconciliationByAccountID[accountId] = {
|
|
964
981
|
...oldRecord,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.51-
|
|
3
|
+
"version": "5.1.51-betaAK3",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|