@zeniai/client-epic-state 4.9.80 → 4.9.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/workingDayHelper.d.ts +1 -0
- package/lib/commonStateTypes/workingDayHelper.js +12 -11
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -2
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +2 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListHelper.js +18 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -17
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailPayload.js +4 -1
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.holidaysFormatted = exports.holidays = exports.PAYMENT_BUSINESS_DAYS = exports.endDate = exports.startDate = void 0;
|
|
6
|
+
exports.isHoliday = exports.getYearsList = exports.filterDays = exports.isHolidayToday = exports.getPreviousNthWorkingDay = exports.getNextNthWorkingDay = exports.holidaysFormatted = exports.holidays = exports.PAYMENT_BUSINESS_DAYS = exports.endDate = exports.startDate = exports.standardFormat = void 0;
|
|
7
7
|
const date_holidays_1 = __importDefault(require("date-holidays"));
|
|
8
8
|
const zeniDayJS_1 = require("../zeniDayJS");
|
|
9
|
-
|
|
9
|
+
exports.standardFormat = 'MM/DD/YYYY';
|
|
10
10
|
exports.startDate = '2000-01-01';
|
|
11
11
|
exports.endDate = '2070-12-31';
|
|
12
12
|
exports.PAYMENT_BUSINESS_DAYS = 4;
|
|
@@ -15,16 +15,16 @@ exports.holidays = dateHolidays
|
|
|
15
15
|
.getHolidays(new Date().getFullYear())
|
|
16
16
|
.filter((holiday) => holiday.type === 'public' || holiday.type === 'bank')
|
|
17
17
|
.map((holiday) => (0, zeniDayJS_1.date)(holiday.date).toDate()); // https://www.linkedin.com/pulse/fix-invalid-date-safari-ie-hatem-ahmad/
|
|
18
|
-
exports.holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(standardFormat));
|
|
18
|
+
exports.holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(exports.standardFormat));
|
|
19
19
|
const getNextNthWorkingDay = (date, filterDaysIndex, numberOfWorkingDays) => {
|
|
20
20
|
const currentDate = new Date(date.toDateString());
|
|
21
|
-
const holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(standardFormat));
|
|
21
|
+
const holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(exports.standardFormat));
|
|
22
22
|
Array(numberOfWorkingDays)
|
|
23
23
|
.fill(0)
|
|
24
24
|
.forEach(() => {
|
|
25
25
|
currentDate.setDate(currentDate.getDate() + 1);
|
|
26
26
|
while (filterDaysIndex.includes(currentDate.getDay()) ||
|
|
27
|
-
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(standardFormat)) != -1) {
|
|
27
|
+
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(exports.standardFormat)) != -1) {
|
|
28
28
|
currentDate.setDate(currentDate.getDate() + 1);
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -33,32 +33,32 @@ const getNextNthWorkingDay = (date, filterDaysIndex, numberOfWorkingDays) => {
|
|
|
33
33
|
exports.getNextNthWorkingDay = getNextNthWorkingDay;
|
|
34
34
|
const getPreviousNthWorkingDay = (date, filterDaysIndex, numberOfWorkingDays) => {
|
|
35
35
|
const currentDate = new Date(date.toDateString());
|
|
36
|
-
const holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(standardFormat));
|
|
36
|
+
const holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(exports.standardFormat));
|
|
37
37
|
Array(numberOfWorkingDays)
|
|
38
38
|
.fill(0)
|
|
39
39
|
.forEach(() => {
|
|
40
40
|
while (filterDaysIndex.includes(currentDate.getDay()) ||
|
|
41
|
-
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(standardFormat)) != -1) {
|
|
41
|
+
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(exports.standardFormat)) != -1) {
|
|
42
42
|
currentDate.setDate(currentDate.getDate() - 1);
|
|
43
43
|
}
|
|
44
44
|
currentDate.setDate(currentDate.getDate() - 1);
|
|
45
45
|
});
|
|
46
46
|
while (filterDaysIndex.includes(currentDate.getDay()) ||
|
|
47
|
-
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(standardFormat)) != -1) {
|
|
47
|
+
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(exports.standardFormat)) != -1) {
|
|
48
48
|
currentDate.setDate(currentDate.getDate() - 1);
|
|
49
49
|
}
|
|
50
50
|
return currentDate;
|
|
51
51
|
};
|
|
52
52
|
exports.getPreviousNthWorkingDay = getPreviousNthWorkingDay;
|
|
53
53
|
const isHolidayToday = (filterDaysIndex) => {
|
|
54
|
-
const holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(standardFormat));
|
|
54
|
+
const holidaysFormatted = exports.holidays.map((holiday) => (0, zeniDayJS_1.date)(holiday.toDateString()).format(exports.standardFormat));
|
|
55
55
|
const currentDate = new Date();
|
|
56
56
|
return (filterDaysIndex.includes(currentDate.getDay()) ||
|
|
57
|
-
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(standardFormat)) != -1);
|
|
57
|
+
holidaysFormatted.indexOf((0, zeniDayJS_1.date)(currentDate.toDateString()).format(exports.standardFormat)) != -1);
|
|
58
58
|
};
|
|
59
59
|
exports.isHolidayToday = isHolidayToday;
|
|
60
60
|
const filterDays = (date, filterDaysIndex) => {
|
|
61
|
-
const formattedDate = (0, zeniDayJS_1.date)(date.toDateString()).format(standardFormat);
|
|
61
|
+
const formattedDate = (0, zeniDayJS_1.date)(date.toDateString()).format(exports.standardFormat);
|
|
62
62
|
return (filterDaysIndex.includes(date.getDay()) === false &&
|
|
63
63
|
exports.holidaysFormatted.includes(formattedDate) === false);
|
|
64
64
|
};
|
|
@@ -81,6 +81,7 @@ const getHolidaysListPerYear = (year) => {
|
|
|
81
81
|
const holidaysPerYear = {
|
|
82
82
|
[(0, zeniDayJS_1.dateNow)().year()]: getHolidaysListPerYear((0, zeniDayJS_1.dateNow)().year()),
|
|
83
83
|
};
|
|
84
|
+
//isHoliday requires date parameter to be simple date Dayjs format, not datetime Dayjs
|
|
84
85
|
const isHoliday = (date) => {
|
|
85
86
|
const currentYear = date.year();
|
|
86
87
|
let holidays = [];
|
package/lib/index.d.ts
CHANGED
|
@@ -593,6 +593,7 @@ export { fetchApAgingDetail, AgingReportInvoice, ApAgingDetail, getApAgingDetail
|
|
|
593
593
|
import { JEScheduledTransaction, ScheduledJournalEntry } from './entity/jeSchedules/jeSchedulesSelector';
|
|
594
594
|
import { ScheduleTypes, ScheduleJournalEntryStatusCodeType, toScheduleTypesType, toScheduleTypesTypeStrict, ScheduleStatusCodeType, JEScheduleKey, ALL_SCHEDULES_TYPES } from './entity/jeSchedules/jeSchedulesTypes';
|
|
595
595
|
import { ScheduleTransaction } from './entity/transaction/stateTypes/scheduleTransaction';
|
|
596
|
+
import { getDefaultSelectedTimeframeForScheduleType } from './view/scheduleView/scheduleListView/scheduleListHelper';
|
|
596
597
|
import { ScheduleListLocalData } from './view/scheduleView/scheduleListView/scheduleListState';
|
|
597
598
|
import { ScheduleSubTabType, ScheduleListSortKey, toScheduleSubTabType, DownloadJEScheduleTabOptions, ScheduleListTabsFileType, toScheduleListTabsFileTypeStrict } from './view/scheduleView/scheduleListView/scheduleListTypes';
|
|
598
599
|
import { fetchScheduleList, fetchSchedulesAccount, updateScheduleListLocalData, updateScheduleListSearchText, updateScheduleListSubTab, updateScheduleListScrollState, updateScheduleListSortState, updateScheduleListDownloadState, fetchDownloadSchedules } from './view/scheduleView/scheduleListView/scheduleListReducer';
|
|
@@ -602,7 +603,7 @@ import { JELinkType, JEScheduleDetailsLocalData, JETransactionLink, ScheduleDeta
|
|
|
602
603
|
import { ScheduleDetailSortKey } from './view/scheduleView/scheduleDetailView/scheduleDetailTypes';
|
|
603
604
|
import { createNewSchedules, fetchScheduleDetails, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, updateSelectedJEScheduleKey, updateScheduleDetailsLocalData, updatedSelectedJELinkRowIndex, updatedJELinkInLocalData, updateAmountsInScheduleDetail, resetJELinkInLocalData, updatedJELinkWithRecommendedLocalData } from './view/scheduleView/scheduleDetailView/scheduleDetailReducer';
|
|
604
605
|
import { getQBOUrlForLink, getThirdPartyIDFromQBOURL } from './view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper';
|
|
605
|
-
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, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, JETransactionLink, updateScheduleListDownloadState, DownloadJEScheduleTabOptions, updatedSelectedJELinkRowIndex, ScheduleListTabsFileType, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, ScheduleDetailUIState, resetJELinkInLocalData, JEScheduledTransactionWithBalance, JELinkType, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, };
|
|
606
|
+
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, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, JETransactionLink, updateScheduleListDownloadState, DownloadJEScheduleTabOptions, updatedSelectedJELinkRowIndex, ScheduleListTabsFileType, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, ScheduleDetailUIState, resetJELinkInLocalData, JEScheduledTransactionWithBalance, JELinkType, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, };
|
|
606
607
|
import { GlobalMerchant, GlobalMerchantBase, TenantMerchant } from './entity/globalMerchant/globalMerchantState';
|
|
607
608
|
export { GlobalMerchant, GlobalMerchantBase, TenantMerchant };
|
|
608
609
|
import { ReviewStatus, VendorReviewRecommendationViewState, VendorReviewRowCurrentSelection } from './view/vendorReviewView/common/state/commonTypes';
|
package/lib/index.js
CHANGED
|
@@ -45,8 +45,8 @@ exports.getAllDepostAccounts = exports.getDepositAccountDetail = exports.unlinkP
|
|
|
45
45
|
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 = 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.fetchReviewTransferDetail = exports.clearReviewTransferDetail = exports.clearTransferDetail = exports.getTransferDetail = exports.transferMoney = exports.updateDepositToLocalData = exports.updateTransferToLocalData = exports.updateTransferMoneyLocalData = exports.fetchZeniAccountsConfig = exports.fetchDepositAccount = exports.getDepositAccountDetailForPDF = void 0;
|
|
46
46
|
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 = 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 = void 0;
|
|
47
47
|
exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.deleteScheduleDetail = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = 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 = void 0;
|
|
48
|
-
exports.
|
|
49
|
-
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = 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 = void 0;
|
|
48
|
+
exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.allTaskTags = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.archiveTask = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = 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.getDefaultSelectedTimeframeForScheduleType = exports.getFetchStateForScheduleListByType = void 0;
|
|
49
|
+
exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = 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 = void 0;
|
|
50
50
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
51
51
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
52
52
|
Object.defineProperty(exports, "updateZeniDateLocaleID", { enumerable: true, get: function () { return zeniDayJS_1.updateZeniDateLocaleID; } });
|
|
@@ -1239,6 +1239,8 @@ const jeSchedulesTypes_1 = require("./entity/jeSchedules/jeSchedulesTypes");
|
|
|
1239
1239
|
Object.defineProperty(exports, "toScheduleTypesType", { enumerable: true, get: function () { return jeSchedulesTypes_1.toScheduleTypesType; } });
|
|
1240
1240
|
Object.defineProperty(exports, "toScheduleTypesTypeStrict", { enumerable: true, get: function () { return jeSchedulesTypes_1.toScheduleTypesTypeStrict; } });
|
|
1241
1241
|
Object.defineProperty(exports, "ALL_SCHEDULES_TYPES", { enumerable: true, get: function () { return jeSchedulesTypes_1.ALL_SCHEDULES_TYPES; } });
|
|
1242
|
+
const scheduleListHelper_1 = require("./view/scheduleView/scheduleListView/scheduleListHelper");
|
|
1243
|
+
Object.defineProperty(exports, "getDefaultSelectedTimeframeForScheduleType", { enumerable: true, get: function () { return scheduleListHelper_1.getDefaultSelectedTimeframeForScheduleType; } });
|
|
1242
1244
|
const scheduleListTypes_1 = require("./view/scheduleView/scheduleListView/scheduleListTypes");
|
|
1243
1245
|
Object.defineProperty(exports, "toScheduleSubTabType", { enumerable: true, get: function () { return scheduleListTypes_1.toScheduleSubTabType; } });
|
|
1244
1246
|
Object.defineProperty(exports, "toScheduleListTabsFileTypeStrict", { enumerable: true, get: function () { return scheduleListTypes_1.toScheduleListTabsFileTypeStrict; } });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NestedAccountHeirarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { Amount } from '../../../commonStateTypes/amount';
|
|
3
3
|
import { COABalance, COABalanceGroupedByPeriod } from '../../../commonStateTypes/coaBalance/coaBalance';
|
|
4
|
-
import { TimeframeTickWithMetaData } from '../../../commonStateTypes/timeframeTick';
|
|
4
|
+
import { TimeframeTick, TimeframeTickWithMetaData } from '../../../commonStateTypes/timeframeTick';
|
|
5
5
|
import { AccountBase, AccountLabel, AccountType } from '../../../entity/account/accountState';
|
|
6
6
|
import { JEScheduledTransaction, ScheduledJournalEntry } from '../../../entity/jeSchedules/jeSchedulesSelector';
|
|
7
7
|
import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
|
|
@@ -94,4 +94,5 @@ export declare const getAccountLabelForScheduleType: (scheduleType: ScheduleType
|
|
|
94
94
|
* @returns
|
|
95
95
|
*/
|
|
96
96
|
export declare const getAccountsTypesForScheduleEpics: () => AccountListTypesPayload;
|
|
97
|
+
export declare const getDefaultSelectedTimeframeForScheduleType: (scheduleType: ScheduleTypes) => TimeframeTick;
|
|
97
98
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAccountsTypesForScheduleEpics = exports.getAccountLabelForScheduleType = exports.getAccountsTypesForScheduleList = exports.getDurationOfMonthOutTotalMonth = exports.calculateCOABalanceGroupedByPeriod = exports.mapScheduleJournalToCOABalance = exports.calculateTotalBalanceTimeframeTick = exports.setDefaultTotalBalanceTimeframeTicks = exports.mapTotalBalanceTimeframeTickToCOAGroupedBalance = exports.getAllTimeframeTicks = exports.getAllAccountNested = exports.getAllAccountBase = exports.getAccountLabelForSchedulesTab = exports.getAccountListKeyForSchedules = exports.getCalculatedScheduleTotals = exports.scheduleTypesAccountLabels = void 0;
|
|
3
|
+
exports.getDefaultSelectedTimeframeForScheduleType = exports.getAccountsTypesForScheduleEpics = exports.getAccountLabelForScheduleType = exports.getAccountsTypesForScheduleList = exports.getDurationOfMonthOutTotalMonth = exports.calculateCOABalanceGroupedByPeriod = exports.mapScheduleJournalToCOABalance = exports.calculateTotalBalanceTimeframeTick = exports.setDefaultTotalBalanceTimeframeTicks = exports.mapTotalBalanceTimeframeTickToCOAGroupedBalance = exports.getAllTimeframeTicks = exports.getAllAccountNested = exports.getAllAccountBase = exports.getAccountLabelForSchedulesTab = exports.getAccountListKeyForSchedules = exports.getCalculatedScheduleTotals = exports.scheduleTypesAccountLabels = void 0;
|
|
4
4
|
const amount_1 = require("../../../commonStateTypes/amount");
|
|
5
5
|
const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
6
6
|
const getFYMonths_1 = require("../../../commonStateTypes/fiscalYearHelpers/getFYMonths");
|
|
@@ -268,3 +268,20 @@ const getAccountsTypesForScheduleEpics = () => {
|
|
|
268
268
|
};
|
|
269
269
|
};
|
|
270
270
|
exports.getAccountsTypesForScheduleEpics = getAccountsTypesForScheduleEpics;
|
|
271
|
+
const getDefaultSelectedTimeframeForScheduleType = (scheduleType) => {
|
|
272
|
+
const thisMonthStart = (0, zeniDayJS_1.dateNow)().startOf('month');
|
|
273
|
+
const thisMonthEnd = (0, zeniDayJS_1.dateNow)().endOf('month');
|
|
274
|
+
switch (scheduleType) {
|
|
275
|
+
case 'fixed_assets':
|
|
276
|
+
return {
|
|
277
|
+
startDate: thisMonthStart.subtract(7, 'year'),
|
|
278
|
+
endDate: thisMonthEnd,
|
|
279
|
+
};
|
|
280
|
+
default:
|
|
281
|
+
return {
|
|
282
|
+
startDate: thisMonthStart.subtract(13, 'month'),
|
|
283
|
+
endDate: thisMonthEnd,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
exports.getDefaultSelectedTimeframeForScheduleType = getDefaultSelectedTimeframeForScheduleType;
|
|
@@ -3,10 +3,10 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
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.initialFixedAssetsScheduleListStateByType = exports.initialScheduleListStateByType = exports.initialJESchedulesForTypeState = exports.initialUIState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
7
6
|
const transactionIDPayload_1 = require("../../../entity/transaction/payloadTypes/transactionIDPayload");
|
|
8
7
|
const scheduleListTypes_1 = require("./scheduleListTypes");
|
|
9
8
|
const transactionDetailState_1 = require("../../transactionDetail/transactionDetailState");
|
|
9
|
+
const scheduleListHelper_1 = require("./scheduleListHelper");
|
|
10
10
|
exports.initialUIState = {
|
|
11
11
|
sortKey: 'transactionDate',
|
|
12
12
|
sortOrder: 'descending',
|
|
@@ -31,16 +31,10 @@ exports.initialScheduleListStateByType = {
|
|
|
31
31
|
jeScheduleKeysByListKey: {},
|
|
32
32
|
scheduleListLocalData: {
|
|
33
33
|
selectedCategoryId: 'all',
|
|
34
|
-
selectedTimeframe:
|
|
35
|
-
startDate: (0, zeniDayJS_1.dateNow)().subtract(1, 'year'),
|
|
36
|
-
endDate: (0, zeniDayJS_1.dateNow)(),
|
|
37
|
-
},
|
|
34
|
+
selectedTimeframe: (0, scheduleListHelper_1.getDefaultSelectedTimeframeForScheduleType)('prepaid_expenses'),
|
|
38
35
|
},
|
|
39
36
|
selectedCategoryId: 'all',
|
|
40
|
-
selectedTimeframe:
|
|
41
|
-
startDate: (0, zeniDayJS_1.dateNow)().subtract(1, 'year'),
|
|
42
|
-
endDate: (0, zeniDayJS_1.dateNow)(),
|
|
43
|
-
},
|
|
37
|
+
selectedTimeframe: (0, scheduleListHelper_1.getDefaultSelectedTimeframeForScheduleType)('prepaid_expenses'),
|
|
44
38
|
downloadState: {
|
|
45
39
|
fetchState: 'Not-Started',
|
|
46
40
|
error: undefined,
|
|
@@ -49,14 +43,8 @@ exports.initialScheduleListStateByType = {
|
|
|
49
43
|
};
|
|
50
44
|
exports.initialFixedAssetsScheduleListStateByType = Object.assign(Object.assign({}, exports.initialScheduleListStateByType), { scheduleListLocalData: {
|
|
51
45
|
selectedCategoryId: 'all',
|
|
52
|
-
selectedTimeframe:
|
|
53
|
-
|
|
54
|
-
endDate: (0, zeniDayJS_1.dateNow)(),
|
|
55
|
-
},
|
|
56
|
-
}, selectedTimeframe: {
|
|
57
|
-
startDate: (0, zeniDayJS_1.dateNow)().subtract(7, 'year'),
|
|
58
|
-
endDate: (0, zeniDayJS_1.dateNow)(),
|
|
59
|
-
} });
|
|
46
|
+
selectedTimeframe: (0, scheduleListHelper_1.getDefaultSelectedTimeframeForScheduleType)('fixed_assets'),
|
|
47
|
+
}, selectedTimeframe: (0, scheduleListHelper_1.getDefaultSelectedTimeframeForScheduleType)('fixed_assets') });
|
|
60
48
|
exports.initialState = {
|
|
61
49
|
listByScheduleType: {
|
|
62
50
|
prepaid_expenses: exports.initialScheduleListStateByType,
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapReviewTransferMoneyPayloadToReviewTransferMoney = void 0;
|
|
4
4
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
5
|
+
const workingDayHelper_1 = require("../../../../commonStateTypes/workingDayHelper");
|
|
5
6
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
6
7
|
const mapReviewTransferMoneyPayloadToReviewTransferMoney = (payload) => ({
|
|
7
8
|
isShowDailyAchLimitWarning: payload.is_show_daily_ach_limit_warning,
|
|
8
9
|
dailyAchDebitLimit: payload.daily_ach_debit_limit != null
|
|
9
10
|
? (0, amount_1.toAmount)(payload.daily_ach_debit_limit.amount, payload.daily_ach_debit_limit.currency_code, payload.daily_ach_debit_limit.currency_symbol)
|
|
10
11
|
: (0, amount_1.toAmount)(0, 'USD', '$'),
|
|
11
|
-
transferSchedules: payload.transfer_schedules.map((transfer_schedule) => (Object.assign(Object.assign({}, (0, amount_1.toAmount)(transfer_schedule.amount, transfer_schedule.currency_code, transfer_schedule.currency_symbol)), { scheduleTime: (0, zeniDayJS_1.
|
|
12
|
+
transferSchedules: payload.transfer_schedules.map((transfer_schedule) => (Object.assign(Object.assign({}, (0, amount_1.toAmount)(transfer_schedule.amount, transfer_schedule.currency_code, transfer_schedule.currency_symbol)), { scheduleTime: (0, zeniDayJS_1.date)(
|
|
13
|
+
//this is required as isHoliday function in src/commonStateTypes/workingDayHelper.ts require date to be simple date Dayjs format, not datetime Dayjs
|
|
14
|
+
(0, zeniDayJS_1.date)(transfer_schedule.schedule_time).format(workingDayHelper_1.standardFormat)) }))),
|
|
12
15
|
});
|
|
13
16
|
exports.mapReviewTransferMoneyPayloadToReviewTransferMoney = mapReviewTransferMoneyPayloadToReviewTransferMoney;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.82",
|
|
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",
|