@zeniai/client-epic-state 4.8.98 → 4.8.99
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/index.d.ts +2 -2
- package/lib/index.js +3 -4
- package/lib/view/companyView/selector/companyManagementViewSelector.js +14 -3
- package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +3 -4
- package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +6 -6
- package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.js +8 -8
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +30 -16
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +62 -49
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +2 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +6 -6
- package/lib/view/scheduleView/scheduleListView/scheduleListState.d.ts +0 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -594,14 +594,14 @@ import { ScheduleTypes, ScheduleJournalEntryStatusCodeType, toScheduleTypesType,
|
|
|
594
594
|
import { ScheduleTransaction } from './entity/transaction/stateTypes/scheduleTransaction';
|
|
595
595
|
import { ScheduleListLocalData } from './view/scheduleView/scheduleListView/scheduleListState';
|
|
596
596
|
import { ScheduleSubTabType, ScheduleListSortKey, toScheduleSubTabType, DownloadJEScheduleTabOptions, ScheduleListTabsFileType, toScheduleListTabsFileTypeStrict } from './view/scheduleView/scheduleListView/scheduleListTypes';
|
|
597
|
-
import { fetchScheduleList, fetchSchedulesAccount, updateScheduleListLocalData, updateScheduleListSearchText, updateScheduleListSubTab,
|
|
597
|
+
import { fetchScheduleList, fetchSchedulesAccount, updateScheduleListLocalData, updateScheduleListSearchText, updateScheduleListSubTab, updateScheduleListScrollState, updateScheduleListSortState, updateScheduleListDownloadState, fetchDownloadSchedules } from './view/scheduleView/scheduleListView/scheduleListReducer';
|
|
598
598
|
import { ScheduleListReport, getScheduleListReport, getFetchStateForScheduleAccountList, JEScheduledTransactionWithBalance, getFetchStateForScheduleListByType } from './view/scheduleView/scheduleListView/scheduleListSelector';
|
|
599
599
|
import { ScheduleDetailsView, getScheduleDetailsView } from './view/scheduleView/scheduleDetailView/scheduleDetailSelector';
|
|
600
600
|
import { JELinkType, JEScheduleDetailsLocalData, JETransactionLink, ScheduleDetailsLocalData, ScheduleDetailUIState, ScheduleDetailsLocalDataFixedAssets } from './view/scheduleView/scheduleDetailView/scheduleDetailState';
|
|
601
601
|
import { ScheduleDetailSortKey } from './view/scheduleView/scheduleDetailView/scheduleDetailTypes';
|
|
602
602
|
import { createNewSchedules, fetchScheduleDetails, fetchScheduleDetailsPage, saveScheduleDetails, updateSelectedJEScheduleKey, updateScheduleDetailsLocalData, updatedSelectedJELinkRowIndex, updatedJELinkInLocalData, updateAmountsInScheduleDetail, resetJELinkInLocalData, updatedJELinkWithRecommendedLocalData } from './view/scheduleView/scheduleDetailView/scheduleDetailReducer';
|
|
603
603
|
import { getQBOUrlForLink, getThirdPartyIDFromQBOURL } from './view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper';
|
|
604
|
-
export { JEScheduleKey, ALL_SCHEDULES_TYPES, JEScheduledTransaction, ScheduleTypes, ScheduleJournalEntryStatusCodeType, ScheduleListReport, getScheduleListReport, ScheduleSubTabType, ScheduleListSortKey, fetchScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, ScheduleListLocalData, ScheduleDetailsLocalDataFixedAssets, ScheduleDetailsView, JEScheduleDetailsLocalData, ScheduleDetailsLocalData, toScheduleSubTabType, ScheduleStatusCodeType, ScheduleTransaction,
|
|
604
|
+
export { JEScheduleKey, ALL_SCHEDULES_TYPES, JEScheduledTransaction, ScheduleTypes, ScheduleJournalEntryStatusCodeType, ScheduleListReport, getScheduleListReport, ScheduleSubTabType, ScheduleListSortKey, fetchScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, ScheduleListLocalData, ScheduleDetailsLocalDataFixedAssets, ScheduleDetailsView, JEScheduleDetailsLocalData, ScheduleDetailsLocalData, toScheduleSubTabType, ScheduleStatusCodeType, ScheduleTransaction, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, ScheduleDetailSortKey, ScheduledJournalEntry, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, createNewSchedules, updateScheduleDetailsLocalData, JETransactionLink, updateScheduleListDownloadState, DownloadJEScheduleTabOptions, updatedSelectedJELinkRowIndex, ScheduleListTabsFileType, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, ScheduleDetailUIState, resetJELinkInLocalData, JEScheduledTransactionWithBalance, JELinkType, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, };
|
|
605
605
|
import { GlobalMerchant, GlobalMerchantBase, TenantMerchant } from './entity/globalMerchant/globalMerchantState';
|
|
606
606
|
export { GlobalMerchant, GlobalMerchantBase, TenantMerchant };
|
|
607
607
|
import { ReviewStatus, VendorReviewRecommendationViewState, VendorReviewRowCurrentSelection } from './view/vendorReviewView/common/state/commonTypes';
|
package/lib/index.js
CHANGED
|
@@ -43,9 +43,9 @@ exports.clearAddRemiAutoFields = exports.clearTentativeMerchantName = exports.up
|
|
|
43
43
|
exports.getVendorList = exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.getInternationalSubConfigCodeKey = exports.shouldEnableCalendarPickerForLastReportSent = exports.canSendMonthEndEmailReport = exports.showReimbursementPromoPage = exports.showBillPayPromoPage = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getSnackbar = exports.closeSnackbar = exports.openSnackbar = exports.getChangedLineItemCountFromLocalData = exports.getTransactionListUIStateByCategoryType = exports.getTransactionsListByCategoryType = exports.retryBankAccountConnectionForOnboarding = exports.sendOnboardingCustomerViewInvite = exports.resetNewOnboardedCustomerId = exports.updateOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerDataInLocalStore = exports.saveOnboardingCustomerNotes = exports.saveOnboardingCustomerViewUpdates = exports.updateStatusAfterOnboardingCompleted = exports.updateCustomerCreationStatus = exports.updateOnboardingCustomerListUIState = exports.saveOnboardingCustomerViewUpdateData = exports.clearOnboardingCustomerViewUpdateData = exports.initializeOnboardingCustomerViewUpdateData = exports.getOnboardingEmailGroup = exports.getNewOnboardingCustomerView = exports.getOnboardingCockpitView = exports.saveOnboardingCustomerCompletedStatus = exports.fetchOnboardingCompletedCompanies = exports.fetchCompanyOnboardingView = exports.PAYMENT_BUSINESS_DAYS = exports.holidaysFormatted = exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.toFileTypeStrict = exports.ALL_FILE_TYPES = exports.reduceAllFetchState = exports.reduceAnyFetchState = exports.reduceFetchState = void 0;
|
|
44
44
|
exports.ZENI_CLEARING_ACCOUNT = exports.isZeniClearingAccountReport = exports.getCompanyConfig = exports.fetchCompanyConfig = exports.clearTransactionVendorSaveStatus = exports.resetTransactionVendorLocalData = exports.updateTransactionVendorLocalData = exports.saveTransactionVendorSuccessOrFailure = exports.saveTransactionVendor = exports.getTransactionVendorView = exports.getZeniAccStatements = exports.fetchZeniAccStatementPage = exports.getDepositAccountTransactionList = exports.fetchDepositAccountTransactionList = exports.fetchDepositAccountHistoryFailure = exports.fetchDepositAccountHistorySuccess = exports.updateDepositAccount = exports.getCheckDepositDetail = exports.clearCheckDeposit = exports.updateCheckDepositLocalData = exports.depositCheck = exports.ZENI_ACCOUNTS_TAB = exports.fetchDepositAccountDetail = exports.clearTransferDetail = exports.getTransferDetail = exports.transferMoney = exports.updateDepositToLocalData = exports.updateTransferToLocalData = exports.updateTransferMoneyLocalData = exports.fetchZeniAccountsConfig = exports.fetchDepositAccount = exports.getDepositAccountDetailForPDF = exports.getDepositAccountDetail = exports.unlinkPaymentAccount = exports.fetchPaymentAccountList = exports.createCheckingAccount = exports.updateZeniAccountListTab = exports.fetchZeniAccountList = exports.getZeniAccountList = exports.getZeniAccountsConfigDetail = exports.fetchOwnerList = exports.fetchRecommendationByEntityName = exports.fetchRecommendationByEntityId = exports.fetchRecommendationByEntityQboId = exports.toVendorReportIDType = exports.isVendorsTabVisible = exports.isColumnYTDSpend = exports.updateYTDSelectionUIState = exports.updatePageToken = exports.updateSortUiState = void 0;
|
|
45
45
|
exports.clearCompanyHealthMetricView = exports.updateCompanyHealth = exports.updateCompaniesHealth = exports.getUserRoleConfig = exports.fetchUserRoleConfig = exports.clearInternationalWire = exports.deletePaymentInstrument = exports.createPaymentInstrumentUpdateStatus = exports.createPaymentInstrument = exports.fetchInternationalWireDynamicForm = exports.initializeDynamicForm = exports.updateInternationalWireLocalStoreData = exports.initializeInternationalWireLocalData = exports.getInternationalWireView = exports.fetchWiseRedirectStatus = exports.getWiseRedirect = exports.saveMagicLinkAddressInLocalStore = exports.fetchMagicLinkBankNameBySwift = exports.fetchMagicLinkBankNameByRouting = exports.updateMagicLinkInternationalBankAccountLocalStoreData = exports.updateMagicLinkBankAccountLocalStoreData = exports.saveBankAccount = exports.fetchBillAttachment = exports.fetchMagicLinkTenant = exports.getMagicLinkCurrentAddressState = exports.getMagicLinkBankAccountView = exports.getMagicLinkView = exports.initializeAccountMappingView = exports.getAccountMappingView = exports.clearAccountMappingLocalData = exports.saveAccountMappingLocalData = exports.saveAccountMapping = exports.getOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.clearOnboardingCustomerView = exports.saveOnboardingCustomerViewDataInLocalStore = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.updateOnboardingCustomerViewUIState = exports.updateCurrentStep = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerView = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingCustomerViewCompleteStatus = exports.updateOnboardingCustomerViewAccountDetails = exports.establishOnboardingPlaidConnection = exports.getOnboardingPlaidLinkToken = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.isZeniClearingAccount = void 0;
|
|
46
|
-
exports.
|
|
47
|
-
exports.toRecurringBillFrequency = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getFetchStateForScheduleListByType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey =
|
|
48
|
-
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.closeReferralInviteConfirmationPopup = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.allTaskTags = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks =
|
|
46
|
+
exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = exports.toScheduleSubTabType = exports.toScheduleListTabsFileTypeStrict = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.getFetchStateForScheduleAccountList = exports.updateScheduleListLocalData = exports.fetchSchedulesAccount = exports.fetchDownloadSchedules = exports.fetchScheduleList = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.updateApAgingDetailUIState = exports.getApAgingDetailForVendor = exports.fetchApAgingDetail = exports.updateApAgingUIState = exports.getApAgingReport = exports.fetchApAging = exports.updateChargeCardDetail = exports.updateChargeCardListUIState = exports.updateChargeCardListSearchText = exports.resetIssueChargeCardForm = exports.updateChargeCardLocalStore = exports.issueChargeCard = exports.acceptChargeCardTerms = exports.fetchChargeCardSetupView = exports.getChargeCardSetupViewDetails = exports.toCreditLimitFrequencyCodeType = exports.toChargeCardSortKeyType = exports.fetchChargeCardTransactionList = exports.getChargeCardDetailView = exports.fetchChargeCardDetailPage = exports.getChargeCardListView = exports.fetchChargeCardListPage = exports.getChargeCardBusinessVerificationDetails = exports.companyHealthMetricDropDownOptions = exports.hasCompanyHealthMetricFormFieldChanged = exports.getCompanyHealthMetricView = exports.isCompanyRunwayInfinite = exports.updateCompanyHealthViewUIState = exports.updateCompanyHealthMetricViewSuccessStatus = exports.updateCompanyHealthMetricViewErrorStatus = exports.updateCompanyHealthMetricLocalStore = exports.saveCompanyHealthMetricById = exports.removeSelectedCompanyId = exports.initializeCompanyHealthMetricViewLocalData = exports.fetchCompanyHealthMetricView = void 0;
|
|
47
|
+
exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getFetchStateForScheduleListByType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = void 0;
|
|
48
|
+
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.closeReferralInviteConfirmationPopup = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = exports.getInviteFormView = exports.getReferralListView = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.allTaskTags = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = void 0;
|
|
49
49
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
50
50
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
51
51
|
Object.defineProperty(exports, "updateZeniDateLocaleID", { enumerable: true, get: function () { return zeniDayJS_1.updateZeniDateLocaleID; } });
|
|
@@ -1210,7 +1210,6 @@ Object.defineProperty(exports, "fetchSchedulesAccount", { enumerable: true, get:
|
|
|
1210
1210
|
Object.defineProperty(exports, "updateScheduleListLocalData", { enumerable: true, get: function () { return scheduleListReducer_1.updateScheduleListLocalData; } });
|
|
1211
1211
|
Object.defineProperty(exports, "updateScheduleListSearchText", { enumerable: true, get: function () { return scheduleListReducer_1.updateScheduleListSearchText; } });
|
|
1212
1212
|
Object.defineProperty(exports, "updateScheduleListSubTab", { enumerable: true, get: function () { return scheduleListReducer_1.updateScheduleListSubTab; } });
|
|
1213
|
-
Object.defineProperty(exports, "updateScheduleListTab", { enumerable: true, get: function () { return scheduleListReducer_1.updateScheduleListTab; } });
|
|
1214
1213
|
Object.defineProperty(exports, "updateScheduleListScrollState", { enumerable: true, get: function () { return scheduleListReducer_1.updateScheduleListScrollState; } });
|
|
1215
1214
|
Object.defineProperty(exports, "updateScheduleListSortState", { enumerable: true, get: function () { return scheduleListReducer_1.updateScheduleListSortState; } });
|
|
1216
1215
|
Object.defineProperty(exports, "updateScheduleListDownloadState", { enumerable: true, get: function () { return scheduleListReducer_1.updateScheduleListDownloadState; } });
|
|
@@ -285,11 +285,19 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
285
285
|
companiesWithNoSortKeyValue.push(company);
|
|
286
286
|
}
|
|
287
287
|
break;
|
|
288
|
+
case 'bookCloseDate':
|
|
289
|
+
if (company.company.company.companyInfo.bookCloseDate != null) {
|
|
290
|
+
companiesWithSortKeyValue.push(company);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
companiesWithNoSortKeyValue.push(company);
|
|
294
|
+
}
|
|
295
|
+
break;
|
|
288
296
|
}
|
|
289
297
|
});
|
|
290
298
|
const sortedCompaniesWithSortKeyValue = (0, orderBy_1.default)(companiesWithSortKeyValue, [
|
|
291
299
|
(company) => {
|
|
292
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
300
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
293
301
|
let primarySortValue;
|
|
294
302
|
let secondarySortValue;
|
|
295
303
|
const managegmentInfo = company.company.company.managegmentInfo;
|
|
@@ -348,10 +356,13 @@ const sortAndFilterCompanies = (sortKey, sortOrder, filterText, companies, userS
|
|
|
348
356
|
? customerSatisfactionState_1.customerRatingValues[managegmentInfo.customerSatisfaction.customerRating]
|
|
349
357
|
: 0);
|
|
350
358
|
break;
|
|
359
|
+
case 'bookCloseDate':
|
|
360
|
+
primarySortValue = ((_q = company.company.company.companyInfo.bookCloseDate) !== null && _q !== void 0 ? _q : (0, zeniDayJS_1.date)('1970-01-01T00:00:00.000Z')).valueOf();
|
|
361
|
+
break;
|
|
351
362
|
case 'status':
|
|
352
363
|
default:
|
|
353
|
-
primarySortValue = cockpitTypes_1.MANAGEMENT_STATUS_CODES.indexOf((
|
|
354
|
-
secondarySortValue = (
|
|
364
|
+
primarySortValue = cockpitTypes_1.MANAGEMENT_STATUS_CODES.indexOf((_r = managegmentInfo.statusCode) === null || _r === void 0 ? void 0 : _r.toLowerCase());
|
|
365
|
+
secondarySortValue = (_s = managegmentInfo.companyGroupId) === null || _s === void 0 ? void 0 : _s.toLowerCase();
|
|
355
366
|
}
|
|
356
367
|
return [primarySortValue, secondarySortValue];
|
|
357
368
|
},
|
|
@@ -12,7 +12,7 @@ const scheduleDetailPayload_1 = require("../scheduleDetailPayload");
|
|
|
12
12
|
const saveScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.saveScheduleDetails.match), (0, operators_1.mergeMap)((action) => {
|
|
13
13
|
var _a;
|
|
14
14
|
const state = state$.value;
|
|
15
|
-
const { scheduleDetailState
|
|
15
|
+
const { scheduleDetailState } = state;
|
|
16
16
|
const { selectedJeScheduleDetailId, scheduleType } = action.payload;
|
|
17
17
|
const selectedJEScheduleKey = scheduleDetailState.selectedJEScheduleKey;
|
|
18
18
|
const actions = [];
|
|
@@ -25,10 +25,9 @@ const saveScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
25
25
|
const scheduleDetailsUpdated = scheduleDetailId != null
|
|
26
26
|
? state.scheduleDetailState.editScheduleStateByDetailId[scheduleType][scheduleDetailId]
|
|
27
27
|
: state.scheduleDetailState.newScheduleState[scheduleType];
|
|
28
|
-
const
|
|
29
|
-
const payload = Object.assign({}, (0, scheduleDetailPayload_1.prepareScheduleDetailPayload)(state, scheduleDetailsUpdated, selectedJEScheduleKey, currentTab));
|
|
28
|
+
const payload = Object.assign({}, (0, scheduleDetailPayload_1.prepareScheduleDetailPayload)(state, scheduleDetailsUpdated, selectedJEScheduleKey, scheduleType));
|
|
30
29
|
const queryParam = {
|
|
31
|
-
je_schedule_type:
|
|
30
|
+
je_schedule_type: scheduleType,
|
|
32
31
|
};
|
|
33
32
|
const saveScheduleDetailsApi = scheduleDetailId != null
|
|
34
33
|
? zeniAPI.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/schedules/${scheduleDetailId}?query=${encodeURIComponent(JSON.stringify(queryParam))}`, payload)
|
|
@@ -10,10 +10,10 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
|
10
10
|
const timeframeTick_1 = require("../../../../commonStateTypes/timeframeTick");
|
|
11
11
|
const scheduleListTypes_1 = require("../scheduleListTypes");
|
|
12
12
|
const fetchDownloadSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleListReducer_1.fetchDownloadSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const {
|
|
13
|
+
const { scheduleType, downloadCategories } = action.payload;
|
|
14
14
|
const scheduleListState = state$.value.scheduleListState;
|
|
15
15
|
// if parameters are provided, use those. else go to localdata
|
|
16
|
-
const scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState,
|
|
16
|
+
const scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState, scheduleType);
|
|
17
17
|
const timeframe = action.payload.timeframeAndCategory != null
|
|
18
18
|
? action.payload.timeframeAndCategory.selectedTimeframe
|
|
19
19
|
: scheduleState.selectedTimeframe;
|
|
@@ -27,7 +27,7 @@ const fetchDownloadSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
27
27
|
const queryParam = {
|
|
28
28
|
start_date: (0, timePeriod_1.toString)(timePeriod.start),
|
|
29
29
|
end_date: (0, timePeriod_1.toString)(timePeriod.end),
|
|
30
|
-
je_schedule_type:
|
|
30
|
+
je_schedule_type: scheduleType,
|
|
31
31
|
base_txn_account_ids: downloadCategories,
|
|
32
32
|
sort_by: 'transaction_date',
|
|
33
33
|
sort_order: 'desc',
|
|
@@ -40,14 +40,14 @@ const fetchDownloadSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
40
40
|
const updateActions = [
|
|
41
41
|
(0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules),
|
|
42
42
|
(0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries),
|
|
43
|
-
(0, scheduleListReducer_1.updateDownloadScheduleSuccess)(
|
|
43
|
+
(0, scheduleListReducer_1.updateDownloadScheduleSuccess)(scheduleType, timeframe, categoryId, response.data.je_schedules),
|
|
44
44
|
];
|
|
45
45
|
return (0, rxjs_1.from)(updateActions);
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
|
-
return (0, rxjs_1.of)((0, scheduleListReducer_1.updateDownloadScheduleFailure)(
|
|
48
|
+
return (0, rxjs_1.of)((0, scheduleListReducer_1.updateDownloadScheduleFailure)(scheduleType, timeframe, categoryId, response.status));
|
|
49
49
|
}
|
|
50
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, scheduleListReducer_1.updateDownloadScheduleFailure)(
|
|
50
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, scheduleListReducer_1.updateDownloadScheduleFailure)(scheduleType, timeframe, categoryId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Schedule Download REST API call errored out' +
|
|
51
51
|
JSON.stringify(error))))));
|
|
52
52
|
}));
|
|
53
53
|
exports.fetchDownloadSchedulesEpic = fetchDownloadSchedulesEpic;
|
|
@@ -12,10 +12,10 @@ const scheduleListHelper_1 = require("../scheduleListHelper");
|
|
|
12
12
|
const scheduleListTypes_1 = require("../scheduleListTypes");
|
|
13
13
|
const accountListSelector_1 = require("../../../accountList/accountListSelector");
|
|
14
14
|
const fetchScheduleListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(scheduleListReducer_1.fetchScheduleList.match), (0, operators_1.mergeMap)((action) => {
|
|
15
|
-
const {
|
|
15
|
+
const { scheduleType } = action.payload;
|
|
16
16
|
const { scheduleListState, accountListState } = state$.value;
|
|
17
17
|
// if parameters are provided, use those. else go to localdata
|
|
18
|
-
const scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState,
|
|
18
|
+
const scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState, scheduleType);
|
|
19
19
|
const timeframe = action.payload.timeframeAndCategory != null
|
|
20
20
|
? action.payload.timeframeAndCategory.selectedTimeframe
|
|
21
21
|
: scheduleState.selectedTimeframe;
|
|
@@ -30,8 +30,8 @@ const fetchScheduleListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
30
30
|
action.payload.cacheOverride === false) {
|
|
31
31
|
return (0, rxjs_1.from)([]);
|
|
32
32
|
}
|
|
33
|
-
const accountTypes = (0, scheduleListHelper_1.getAccountsTypesForScheduleList)(
|
|
34
|
-
const accountLabel = (0, scheduleListHelper_1.getAccountLabelForScheduleType)(
|
|
33
|
+
const accountTypes = (0, scheduleListHelper_1.getAccountsTypesForScheduleList)(scheduleType);
|
|
34
|
+
const accountLabel = (0, scheduleListHelper_1.getAccountLabelForScheduleType)(scheduleType);
|
|
35
35
|
const scheduleListCurrentTabAccountIds = accountLabel != null
|
|
36
36
|
? (0, accountListSelector_1.getAccountIdsForLabel)(accountListState, accountTypes.accountListKey, accountLabel)
|
|
37
37
|
: [];
|
|
@@ -42,7 +42,7 @@ const fetchScheduleListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
42
42
|
const queryParam = {
|
|
43
43
|
start_date: (0, timePeriod_1.toString)(timePeriod.start),
|
|
44
44
|
end_date: (0, timePeriod_1.toString)(timePeriod.end),
|
|
45
|
-
je_schedule_type:
|
|
45
|
+
je_schedule_type: scheduleType,
|
|
46
46
|
base_txn_account_ids: categoryIds,
|
|
47
47
|
// these are hard coded since sorting and filtering are at the client end
|
|
48
48
|
sort_by: 'transaction_date',
|
|
@@ -54,13 +54,13 @@ const fetchScheduleListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, o
|
|
|
54
54
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
55
55
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
56
56
|
const updateActions = [];
|
|
57
|
-
updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules), (0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries), (0, scheduleListReducer_1.updateScheduleListSuccess)(
|
|
57
|
+
updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules), (0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries), (0, scheduleListReducer_1.updateScheduleListSuccess)(scheduleType, timeframe, categoryId, response.data.je_schedules));
|
|
58
58
|
return (0, rxjs_1.from)(updateActions);
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
|
-
return (0, rxjs_1.of)((0, scheduleListReducer_1.updateScheduleListFailure)(
|
|
61
|
+
return (0, rxjs_1.of)((0, scheduleListReducer_1.updateScheduleListFailure)(scheduleType, timeframe, categoryId, response.status));
|
|
62
62
|
}
|
|
63
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, scheduleListReducer_1.updateScheduleListFailure)(
|
|
63
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, scheduleListReducer_1.updateScheduleListFailure)(scheduleType, timeframe, categoryId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Schedule List REST API call errored out' +
|
|
64
64
|
JSON.stringify(error))))));
|
|
65
65
|
}));
|
|
66
66
|
exports.fetchScheduleListEpic = fetchScheduleListEpic;
|
|
@@ -3,14 +3,14 @@ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderType
|
|
|
3
3
|
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
4
4
|
import { TimeframeTick } from '../../../commonStateTypes/timeframeTick';
|
|
5
5
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
6
|
-
import { ScheduleListSortKey } from './scheduleListTypes';
|
|
6
|
+
import { ScheduleListSortKey, ScheduleSubTabType } from './scheduleListTypes';
|
|
7
7
|
import { JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
|
|
8
8
|
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
9
9
|
export declare const initialUIState: ScheduleListUIState;
|
|
10
10
|
export declare const initialJESchedulesForTypeState: JESchedulesForTypeState;
|
|
11
11
|
export declare const initialScheduleListStateByType: ScheduleListForTypeState;
|
|
12
12
|
export declare const initialState: ScheduleListViewState;
|
|
13
|
-
export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
13
|
+
export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory: {
|
|
14
14
|
selectedTimeframe: TimeframeTick;
|
|
15
15
|
selectedCategoryId: ID;
|
|
16
16
|
}, downloadCategories: string[], cacheOverride?: any], {
|
|
@@ -18,10 +18,10 @@ export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCr
|
|
|
18
18
|
selectedTimeframe: TimeframeTick;
|
|
19
19
|
selectedCategoryId: ID;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
22
22
|
cacheOverride: any;
|
|
23
23
|
downloadCategories: string[];
|
|
24
|
-
}, string, never, never>, fetchScheduleList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
24
|
+
}, string, never, never>, fetchScheduleList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", timeframeAndCategory?: {
|
|
25
25
|
selectedTimeframe: TimeframeTick;
|
|
26
26
|
selectedCategoryId: ID;
|
|
27
27
|
} | undefined, cacheOverride?: any], {
|
|
@@ -29,34 +29,48 @@ export declare const fetchDownloadSchedules: import("@reduxjs/toolkit").ActionCr
|
|
|
29
29
|
selectedTimeframe: TimeframeTick;
|
|
30
30
|
selectedCategoryId: ID;
|
|
31
31
|
} | undefined;
|
|
32
|
-
|
|
32
|
+
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
33
33
|
cacheOverride: any;
|
|
34
|
-
}, string, never, never>, fetchSchedulesAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateScheduleListSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
35
|
-
|
|
34
|
+
}, string, never, never>, fetchSchedulesAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateScheduleListSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedTimeframe: TimeframeTick, selectedCategoryId: string, scheduleList: JEScheduledTransactionPayload[]], {
|
|
35
|
+
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
36
36
|
selectedTimeframe: TimeframeTick;
|
|
37
37
|
selectedCategoryId: string;
|
|
38
38
|
scheduleList: JEScheduledTransactionPayload[];
|
|
39
|
-
}, string, never, never>, updateScheduleListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
39
|
+
}, string, never, never>, updateScheduleListFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedTimeframe: TimeframeTick, selectedCategoryId: string, error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
40
40
|
selectedCategoryId: string;
|
|
41
41
|
selectedTimeframe: TimeframeTick;
|
|
42
|
-
|
|
42
|
+
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
43
43
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
44
|
-
}, string, never, never>, updateDownloadScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
44
|
+
}, string, never, never>, updateDownloadScheduleFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedTimeframe: TimeframeTick, selectedCategoryId: string, error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
45
45
|
selectedCategoryId: string;
|
|
46
46
|
selectedTimeframe: TimeframeTick;
|
|
47
|
-
|
|
47
|
+
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
48
48
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
49
|
-
}, string, never, never>, updateDownloadScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
50
|
-
|
|
49
|
+
}, string, never, never>, updateDownloadScheduleSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", selectedTimeframe: TimeframeTick, selectedCategoryId: string, scheduleList: JEScheduledTransactionPayload[]], {
|
|
50
|
+
scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
|
|
51
51
|
selectedTimeframe: TimeframeTick;
|
|
52
52
|
selectedCategoryId: string;
|
|
53
53
|
scheduleList: JEScheduledTransactionPayload[];
|
|
54
|
-
}, string, never, never>,
|
|
54
|
+
}, string, never, never>, updateScheduleListSubTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
55
|
+
scheduleType: ScheduleTypes;
|
|
56
|
+
subTab: ScheduleSubTabType;
|
|
57
|
+
}, string>, updateScheduleListScrollState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
|
+
scheduleType: ScheduleTypes;
|
|
55
59
|
scrollYOffset: number;
|
|
56
60
|
}, string>, updateScheduleListSortState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
61
|
+
scheduleType: ScheduleTypes;
|
|
57
62
|
sortKey: ScheduleListSortKey;
|
|
58
63
|
sortOrder: SortOrder;
|
|
59
|
-
}, string>, updateScheduleListLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<
|
|
64
|
+
}, string>, updateScheduleListLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
65
|
+
scheduleType: ScheduleTypes;
|
|
66
|
+
localData: ScheduleListLocalData;
|
|
67
|
+
}, string>, updateScheduleListSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
68
|
+
scheduleType: ScheduleTypes;
|
|
69
|
+
searchText: string;
|
|
70
|
+
}, string>, updateScheduleListDownloadState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
71
|
+
scheduleType: ScheduleTypes;
|
|
72
|
+
fetchState: FetchState;
|
|
73
|
+
}, string>, clearScheduleList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
60
74
|
declare const _default: import("@reduxjs/toolkit").Reducer<ScheduleListViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
61
75
|
export default _default;
|
|
62
|
-
export declare function getState(state: ScheduleListViewState,
|
|
76
|
+
export declare function getState(state: ScheduleListViewState, scheduleType: ScheduleTypes): ScheduleListForTypeState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getState = exports.clearScheduleList = exports.updateScheduleListDownloadState = exports.updateScheduleListSearchText = exports.updateScheduleListLocalData = exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSubTab = exports.
|
|
4
|
+
exports.getState = exports.clearScheduleList = exports.updateScheduleListDownloadState = exports.updateScheduleListSearchText = exports.updateScheduleListLocalData = exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSubTab = exports.updateDownloadScheduleSuccess = exports.updateDownloadScheduleFailure = exports.updateScheduleListFailure = exports.updateScheduleListSuccess = exports.fetchSchedulesAccount = exports.fetchScheduleList = exports.fetchDownloadSchedules = exports.initialState = exports.initialScheduleListStateByType = exports.initialJESchedulesForTypeState = exports.initialUIState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
7
7
|
const transactionIDPayload_1 = require("../../../entity/transaction/payloadTypes/transactionIDPayload");
|
|
@@ -54,7 +54,6 @@ exports.initialState = {
|
|
|
54
54
|
deferred_revenue: exports.initialScheduleListStateByType,
|
|
55
55
|
accrued_expenses: exports.initialScheduleListStateByType,
|
|
56
56
|
},
|
|
57
|
-
currentTab: 'prepaid_expenses',
|
|
58
57
|
};
|
|
59
58
|
const scheduleListView = (0, toolkit_1.createSlice)({
|
|
60
59
|
name: 'scheduleListView',
|
|
@@ -62,7 +61,7 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
62
61
|
reducers: {
|
|
63
62
|
fetchDownloadSchedules: {
|
|
64
63
|
reducer(draft, action) {
|
|
65
|
-
const state = getState(draft, action.payload.
|
|
64
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
66
65
|
const selectedTimeframe = action.payload.timeframeAndCategory.selectedTimeframe;
|
|
67
66
|
const selectedCategoryId = action.payload.timeframeAndCategory.selectedCategoryId;
|
|
68
67
|
state.scheduleListLocalData = {
|
|
@@ -80,13 +79,13 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
80
79
|
if (record == null) {
|
|
81
80
|
state.jeScheduleKeysByListKey[key] = Object.assign({}, exports.initialJESchedulesForTypeState);
|
|
82
81
|
}
|
|
83
|
-
updateState(draft, action.payload.
|
|
82
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
84
83
|
},
|
|
85
|
-
prepare(
|
|
84
|
+
prepare(scheduleType, timeframeAndCategory, downloadCategories, cacheOverride = false) {
|
|
86
85
|
return {
|
|
87
86
|
payload: {
|
|
88
87
|
timeframeAndCategory,
|
|
89
|
-
|
|
88
|
+
scheduleType,
|
|
90
89
|
cacheOverride,
|
|
91
90
|
downloadCategories,
|
|
92
91
|
},
|
|
@@ -98,7 +97,7 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
98
97
|
},
|
|
99
98
|
fetchScheduleList: {
|
|
100
99
|
reducer(draft, action) {
|
|
101
|
-
const state = getState(draft, action.payload.
|
|
100
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
102
101
|
const selectedTimeframe = action.payload.timeframeAndCategory != null
|
|
103
102
|
? action.payload.timeframeAndCategory.selectedTimeframe
|
|
104
103
|
: state.selectedTimeframe;
|
|
@@ -116,13 +115,13 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
116
115
|
if (record == null) {
|
|
117
116
|
state.jeScheduleKeysByListKey[key] = Object.assign(Object.assign({}, exports.initialJESchedulesForTypeState), { fetchState: 'In-Progress' });
|
|
118
117
|
}
|
|
119
|
-
updateState(draft, action.payload.
|
|
118
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
120
119
|
},
|
|
121
|
-
prepare(
|
|
120
|
+
prepare(scheduleType, timeframeAndCategory, cacheOverride = false) {
|
|
122
121
|
return {
|
|
123
122
|
payload: {
|
|
124
123
|
timeframeAndCategory,
|
|
125
|
-
|
|
124
|
+
scheduleType,
|
|
126
125
|
cacheOverride,
|
|
127
126
|
},
|
|
128
127
|
};
|
|
@@ -130,40 +129,52 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
130
129
|
},
|
|
131
130
|
updateScheduleListSuccess: {
|
|
132
131
|
reducer(draft, action) {
|
|
133
|
-
doUpdateScheduleList(draft, action.payload.scheduleList, action.payload.
|
|
132
|
+
doUpdateScheduleList(draft, action.payload.scheduleList, action.payload.scheduleType, action.payload.selectedTimeframe, action.payload.selectedCategoryId);
|
|
134
133
|
},
|
|
135
|
-
prepare(
|
|
134
|
+
prepare(scheduleType, selectedTimeframe, selectedCategoryId, scheduleList) {
|
|
136
135
|
return {
|
|
137
|
-
payload: {
|
|
136
|
+
payload: {
|
|
137
|
+
scheduleType,
|
|
138
|
+
selectedTimeframe,
|
|
139
|
+
selectedCategoryId,
|
|
140
|
+
scheduleList,
|
|
141
|
+
},
|
|
138
142
|
};
|
|
139
143
|
},
|
|
140
144
|
},
|
|
141
145
|
updateScheduleListFailure: {
|
|
142
146
|
reducer(draft, action) {
|
|
143
|
-
const state = getState(draft, action.payload.
|
|
147
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
144
148
|
const key = (0, scheduleListTypes_1.getScheduleListKey)(action.payload.selectedCategoryId, action.payload.selectedTimeframe);
|
|
145
149
|
state.jeScheduleKeysByListKey[key] = Object.assign(Object.assign({}, exports.initialJESchedulesForTypeState), { fetchState: 'Error', error: action.payload.error });
|
|
146
150
|
state.selectedCategoryId = action.payload.selectedCategoryId;
|
|
147
151
|
state.selectedTimeframe = action.payload.selectedTimeframe;
|
|
148
|
-
updateState(draft, action.payload.
|
|
152
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
149
153
|
},
|
|
150
|
-
prepare(
|
|
151
|
-
return {
|
|
154
|
+
prepare(scheduleType, selectedTimeframe, selectedCategoryId, error) {
|
|
155
|
+
return {
|
|
156
|
+
payload: { selectedCategoryId, selectedTimeframe, scheduleType, error },
|
|
157
|
+
};
|
|
152
158
|
},
|
|
153
159
|
},
|
|
154
160
|
updateDownloadScheduleSuccess: {
|
|
155
161
|
reducer(draft, action) {
|
|
156
|
-
doUpdateScheduleList(draft, action.payload.scheduleList, action.payload.
|
|
162
|
+
doUpdateScheduleList(draft, action.payload.scheduleList, action.payload.scheduleType, action.payload.selectedTimeframe, action.payload.selectedCategoryId);
|
|
157
163
|
},
|
|
158
|
-
prepare(
|
|
164
|
+
prepare(scheduleType, selectedTimeframe, selectedCategoryId, scheduleList) {
|
|
159
165
|
return {
|
|
160
|
-
payload: {
|
|
166
|
+
payload: {
|
|
167
|
+
scheduleType,
|
|
168
|
+
selectedTimeframe,
|
|
169
|
+
selectedCategoryId,
|
|
170
|
+
scheduleList,
|
|
171
|
+
},
|
|
161
172
|
};
|
|
162
173
|
},
|
|
163
174
|
},
|
|
164
175
|
updateDownloadScheduleFailure: {
|
|
165
176
|
reducer(draft, action) {
|
|
166
|
-
const state = getState(draft, action.payload.
|
|
177
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
167
178
|
const key = (0, scheduleListTypes_1.getScheduleListKey)(action.payload.selectedCategoryId, action.payload.selectedTimeframe);
|
|
168
179
|
state.jeScheduleKeysByListKey[key] = Object.assign(Object.assign({}, exports.initialJESchedulesForTypeState), { error: action.payload.error });
|
|
169
180
|
state.selectedCategoryId = action.payload.selectedCategoryId;
|
|
@@ -172,61 +183,63 @@ const scheduleListView = (0, toolkit_1.createSlice)({
|
|
|
172
183
|
fetchState: 'Error',
|
|
173
184
|
error: action.payload.error,
|
|
174
185
|
};
|
|
175
|
-
updateState(draft, action.payload.
|
|
186
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
176
187
|
},
|
|
177
|
-
prepare(
|
|
178
|
-
return {
|
|
188
|
+
prepare(scheduleType, selectedTimeframe, selectedCategoryId, error) {
|
|
189
|
+
return {
|
|
190
|
+
payload: { selectedCategoryId, selectedTimeframe, scheduleType, error },
|
|
191
|
+
};
|
|
179
192
|
},
|
|
180
193
|
},
|
|
181
|
-
updateScheduleListTab(draft, action) {
|
|
182
|
-
draft.currentTab = action.payload;
|
|
183
|
-
},
|
|
184
194
|
updateScheduleListSearchText(draft, action) {
|
|
185
|
-
const state = getState(draft,
|
|
186
|
-
state.uiState.searchText = action.payload;
|
|
187
|
-
updateState(draft,
|
|
195
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
196
|
+
state.uiState.searchText = action.payload.searchText;
|
|
197
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
188
198
|
},
|
|
189
199
|
updateScheduleListSubTab(draft, action) {
|
|
190
|
-
const state = getState(draft,
|
|
191
|
-
state.uiState.currentSubTab = action.payload;
|
|
192
|
-
updateState(draft,
|
|
200
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
201
|
+
state.uiState.currentSubTab = action.payload.subTab;
|
|
202
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
193
203
|
},
|
|
194
204
|
updateScheduleListSortState(draft, action) {
|
|
195
|
-
const tab =
|
|
205
|
+
const tab = action.payload.scheduleType;
|
|
196
206
|
const state = getState(draft, tab);
|
|
197
207
|
state.uiState.sortKey = action.payload.sortKey;
|
|
198
208
|
state.uiState.sortOrder = action.payload.sortOrder;
|
|
199
209
|
updateState(draft, tab, state);
|
|
200
210
|
},
|
|
201
211
|
updateScheduleListScrollState(draft, action) {
|
|
202
|
-
const tab =
|
|
212
|
+
const tab = action.payload.scheduleType;
|
|
203
213
|
const state = getState(draft, tab);
|
|
204
214
|
state.uiState.scrollYOffset[state.uiState.currentSubTab] =
|
|
205
215
|
action.payload.scrollYOffset;
|
|
206
216
|
updateState(draft, tab, state);
|
|
207
217
|
},
|
|
208
218
|
updateScheduleListLocalData(draft, action) {
|
|
209
|
-
const state = getState(draft,
|
|
210
|
-
state.scheduleListLocalData = action.payload;
|
|
211
|
-
updateState(draft,
|
|
219
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
220
|
+
state.scheduleListLocalData = action.payload.localData;
|
|
221
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
212
222
|
},
|
|
213
223
|
updateScheduleListDownloadState(draft, action) {
|
|
214
|
-
const state = getState(draft,
|
|
215
|
-
state.downloadState = {
|
|
216
|
-
|
|
224
|
+
const state = getState(draft, action.payload.scheduleType);
|
|
225
|
+
state.downloadState = {
|
|
226
|
+
fetchState: action.payload.fetchState,
|
|
227
|
+
error: undefined,
|
|
228
|
+
};
|
|
229
|
+
updateState(draft, action.payload.scheduleType, state);
|
|
217
230
|
},
|
|
218
231
|
clearScheduleList(draft) {
|
|
219
232
|
Object.assign(draft, exports.initialState);
|
|
220
233
|
},
|
|
221
234
|
},
|
|
222
235
|
});
|
|
223
|
-
_a = scheduleListView.actions, exports.fetchDownloadSchedules = _a.fetchDownloadSchedules, exports.fetchScheduleList = _a.fetchScheduleList, exports.fetchSchedulesAccount = _a.fetchSchedulesAccount, exports.updateScheduleListSuccess = _a.updateScheduleListSuccess, exports.updateScheduleListFailure = _a.updateScheduleListFailure, exports.updateDownloadScheduleFailure = _a.updateDownloadScheduleFailure, exports.updateDownloadScheduleSuccess = _a.updateDownloadScheduleSuccess, exports.
|
|
236
|
+
_a = scheduleListView.actions, exports.fetchDownloadSchedules = _a.fetchDownloadSchedules, exports.fetchScheduleList = _a.fetchScheduleList, exports.fetchSchedulesAccount = _a.fetchSchedulesAccount, exports.updateScheduleListSuccess = _a.updateScheduleListSuccess, exports.updateScheduleListFailure = _a.updateScheduleListFailure, exports.updateDownloadScheduleFailure = _a.updateDownloadScheduleFailure, exports.updateDownloadScheduleSuccess = _a.updateDownloadScheduleSuccess, exports.updateScheduleListSubTab = _a.updateScheduleListSubTab, exports.updateScheduleListScrollState = _a.updateScheduleListScrollState, exports.updateScheduleListSortState = _a.updateScheduleListSortState, exports.updateScheduleListLocalData = _a.updateScheduleListLocalData, exports.updateScheduleListSearchText = _a.updateScheduleListSearchText, exports.updateScheduleListDownloadState = _a.updateScheduleListDownloadState, exports.clearScheduleList = _a.clearScheduleList;
|
|
224
237
|
exports.default = scheduleListView.reducer;
|
|
225
238
|
/**
|
|
226
239
|
* Helper functions
|
|
227
240
|
*/
|
|
228
|
-
function doUpdateScheduleList(draft, payload,
|
|
229
|
-
const state = getState(draft,
|
|
241
|
+
function doUpdateScheduleList(draft, payload, scheduleType, selectedTimeframe, selectedCategoryId) {
|
|
242
|
+
const state = getState(draft, scheduleType);
|
|
230
243
|
const jeScheduleTransactionKeys = payload.map((schedules) => {
|
|
231
244
|
const transactionID = (0, transactionIDPayload_1.toTransactionID)(schedules.base_transaction);
|
|
232
245
|
return (0, transactionDetailState_1.getZeniTransactionDetailKey)(transactionID);
|
|
@@ -241,11 +254,11 @@ function doUpdateScheduleList(draft, payload, tab, selectedTimeframe, selectedCa
|
|
|
241
254
|
error: undefined,
|
|
242
255
|
};
|
|
243
256
|
}
|
|
244
|
-
function updateState(state,
|
|
245
|
-
const listState = state.listByScheduleType[
|
|
246
|
-
state.listByScheduleType[
|
|
257
|
+
function updateState(state, scheduleType, updates) {
|
|
258
|
+
const listState = state.listByScheduleType[scheduleType];
|
|
259
|
+
state.listByScheduleType[scheduleType] = Object.assign(Object.assign({}, listState), updates);
|
|
247
260
|
}
|
|
248
|
-
function getState(state,
|
|
249
|
-
return state.listByScheduleType[
|
|
261
|
+
function getState(state, scheduleType) {
|
|
262
|
+
return state.listByScheduleType[scheduleType];
|
|
250
263
|
}
|
|
251
264
|
exports.getState = getState;
|
|
@@ -15,7 +15,7 @@ export interface JEScheduledTransactionWithBalance extends JEScheduledTransactio
|
|
|
15
15
|
durationOfMonths: number;
|
|
16
16
|
}
|
|
17
17
|
export interface ScheduleListReport extends SelectorView {
|
|
18
|
-
|
|
18
|
+
scheduleType: ScheduleTypes;
|
|
19
19
|
downloadUIState: FetchStateAndError;
|
|
20
20
|
jeScheduleOrder: EntityOrder;
|
|
21
21
|
jeScheduledTransactions: JEScheduledTransactionWithBalance[];
|
|
@@ -31,6 +31,6 @@ export interface ScheduleListReport extends SelectorView {
|
|
|
31
31
|
totalRunningBalances: Amount;
|
|
32
32
|
selectedScheduledId?: ID;
|
|
33
33
|
}
|
|
34
|
-
export declare const getScheduleListReport: (state: RootState) => ScheduleListReport;
|
|
34
|
+
export declare const getScheduleListReport: (state: RootState, scheduleType: ScheduleTypes) => ScheduleListReport;
|
|
35
35
|
export declare const getFetchStateForScheduleAccountList: (state: RootState) => FetchState;
|
|
36
36
|
export declare const getFetchStateForScheduleListByType: (state: RootState, scheduleType: ScheduleTypes) => FetchState;
|
|
@@ -69,15 +69,15 @@ const sortedJETransactionsView = (jeTransactions, sortKey, sortOrder) => {
|
|
|
69
69
|
}
|
|
70
70
|
}, sortOrder === 'ascending' ? 'asc' : 'desc');
|
|
71
71
|
};
|
|
72
|
-
const getScheduleListReport = (state) => {
|
|
72
|
+
const getScheduleListReport = (state, scheduleType) => {
|
|
73
73
|
const { scheduleListState, accountListState, accountState } = state;
|
|
74
|
-
const scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState,
|
|
74
|
+
const scheduleState = (0, scheduleListReducer_1.getState)(scheduleListState, scheduleType);
|
|
75
75
|
const downloadState = scheduleState.downloadState;
|
|
76
76
|
const allScheduleAccounts = (0, accountListSelector_1.getAccountList)(accountState, accountListState, (0, scheduleListHelper_1.getAccountListKeyForSchedules)());
|
|
77
77
|
let allNestedAccounts = (0, accountListSelector_1.getNestedAccountListHeirarchy)(accountListState, (0, scheduleListHelper_1.getAccountListKeyForSchedules)());
|
|
78
78
|
let allAccounts = allScheduleAccounts.accounts;
|
|
79
|
-
const accountTypes = (0, scheduleListHelper_1.getAccountsTypesForScheduleList)(
|
|
80
|
-
const accountLabel = (0, scheduleListHelper_1.getAccountLabelForScheduleType)(
|
|
79
|
+
const accountTypes = (0, scheduleListHelper_1.getAccountsTypesForScheduleList)(scheduleType);
|
|
80
|
+
const accountLabel = (0, scheduleListHelper_1.getAccountLabelForScheduleType)(scheduleType);
|
|
81
81
|
const scheduleListCurrentTabAccountIds = accountLabel != null
|
|
82
82
|
? (0, accountListSelector_1.getAccountIdsForLabel)(accountListState, accountTypes.accountListKey, accountLabel)
|
|
83
83
|
: [];
|
|
@@ -99,7 +99,7 @@ const getScheduleListReport = (state) => {
|
|
|
99
99
|
status: undefined,
|
|
100
100
|
jeScheduleOrder: 'descending_transaction_date',
|
|
101
101
|
jeScheduledTransactions: [],
|
|
102
|
-
|
|
102
|
+
scheduleType,
|
|
103
103
|
selectedScheduledId: undefined,
|
|
104
104
|
downloadUIState: downloadState,
|
|
105
105
|
selectedCategoryId: scheduleState.selectedCategoryId,
|
|
@@ -173,12 +173,12 @@ const getScheduleListReport = (state) => {
|
|
|
173
173
|
status: undefined,
|
|
174
174
|
jeScheduleOrder: 'descending_transaction_date',
|
|
175
175
|
jeScheduledTransactions: jeScheduledTransactionWithBalance,
|
|
176
|
-
currentTab: scheduleListState.currentTab,
|
|
177
176
|
selectedScheduledId: selectedScheduleId,
|
|
178
177
|
downloadUIState: downloadState,
|
|
179
178
|
selectedCategoryId: scheduleState.selectedCategoryId,
|
|
180
179
|
selectedTimeframe: scheduleState.selectedTimeframe,
|
|
181
180
|
uiState,
|
|
181
|
+
scheduleType,
|
|
182
182
|
scheduleListAccounts: [(0, scheduleListHelper_1.getAllAccountBase)(), ...allAccounts],
|
|
183
183
|
scheduleListNestedAccountHierarchy: [
|
|
184
184
|
(0, scheduleListHelper_1.getAllAccountNested)(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.99",
|
|
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
|
"types": "lib/index.d.ts",
|