@zeniai/client-epic-state 4.7.98 → 4.8.0

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.
Files changed (149) hide show
  1. package/lib/commonPayloadTypes/statusPayload.d.ts +4 -0
  2. package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +3 -0
  3. package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +4 -1
  4. package/lib/commonStateTypes/timePeriod.d.ts +9 -2
  5. package/lib/commonStateTypes/timePeriod.js +12 -1
  6. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +1 -1
  7. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +1 -0
  8. package/lib/entity/account/accountPayload.d.ts +1 -1
  9. package/lib/entity/account/accountSelector.d.ts +3 -3
  10. package/lib/entity/account/accountState.d.ts +4 -4
  11. package/lib/entity/account/accountState.js +1 -0
  12. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -1
  13. package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -22
  14. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  15. package/lib/entity/class/classReducer.d.ts +4 -4
  16. package/lib/entity/class/classState.d.ts +2 -2
  17. package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
  18. package/lib/entity/forecast/forecastState.d.ts +1 -1
  19. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +55 -0
  20. package/lib/entity/jeSchedules/jeSchedulesPayload.js +142 -0
  21. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +11 -0
  22. package/lib/entity/jeSchedules/jeSchedulesReducer.js +91 -0
  23. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +58 -0
  24. package/lib/entity/jeSchedules/jeSchedulesSelector.js +74 -0
  25. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +61 -0
  26. package/lib/entity/jeSchedules/jeSchedulesState.js +2 -0
  27. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +10 -0
  28. package/lib/entity/jeSchedules/jeSchedulesTypes.js +25 -0
  29. package/lib/entity/jeSchedules/updateJESchedulesEpic.d.ts +10 -0
  30. package/lib/entity/jeSchedules/updateJESchedulesEpic.js +65 -0
  31. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  32. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  33. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  34. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  35. package/lib/entity/snackbar/snackbarTypes.js +2 -0
  36. package/lib/entity/tenant/clearAllEpic.d.ts +3 -1
  37. package/lib/entity/tenant/clearAllEpic.js +4 -0
  38. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +12 -0
  39. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +37 -0
  40. package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +3 -3
  41. package/lib/entity/transaction/payloadTypes/transactionPayload.js +1 -1
  42. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +11 -0
  43. package/lib/entity/transaction/stateTypes/scheduleTransaction.js +2 -0
  44. package/lib/entity/transaction/stateTypes/transaction.d.ts +10 -7
  45. package/lib/entity/transaction/stateTypes/transactionType.d.ts +4 -0
  46. package/lib/entity/transaction/stateTypes/transactionType.js +11 -3
  47. package/lib/entity/transaction/transactionReducer.d.ts +7 -0
  48. package/lib/entity/transaction/transactionReducer.js +39 -3
  49. package/lib/entity/transaction/transactionSelector.d.ts +6 -0
  50. package/lib/entity/transaction/transactionSelector.js +19 -0
  51. package/lib/entity/transaction/transactionState.d.ts +3 -0
  52. package/lib/epic.d.ts +77 -67
  53. package/lib/epic.js +11 -1
  54. package/lib/index.d.ts +19 -6
  55. package/lib/index.js +58 -17
  56. package/lib/reducer.d.ts +9 -0
  57. package/lib/reducer.js +9 -0
  58. package/lib/view/accountList/accountListReducer.js +2 -0
  59. package/lib/view/accountList/accountListSelector.d.ts +16 -1
  60. package/lib/view/accountList/accountListSelector.js +33 -4
  61. package/lib/view/accountList/accountListState.d.ts +1 -1
  62. package/lib/view/accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload.d.ts +1 -1
  63. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  64. package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -2
  65. package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -2
  66. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  67. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  68. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  69. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  70. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  71. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  72. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  73. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  74. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  75. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  76. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  77. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +2 -2
  78. package/lib/view/reviewCompanyView/reviewCompanyViewState.js +1 -0
  79. package/lib/view/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.d.ts +6 -0
  80. package/lib/view/scheduleView/scheduleDetailView/epics/createNewSchedulesEpic.js +28 -0
  81. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.d.ts +8 -0
  82. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsEpic.js +51 -0
  83. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +7 -0
  84. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +16 -0
  85. package/lib/view/scheduleView/scheduleDetailView/epics/initializeScheduleDetailLocalDataEpic.d.ts +6 -0
  86. package/lib/view/scheduleView/scheduleDetailView/epics/initializeScheduleDetailLocalDataEpic.js +32 -0
  87. package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.d.ts +11 -0
  88. package/lib/view/scheduleView/scheduleDetailView/epics/saveScheduleDetailsEpic.js +102 -0
  89. package/lib/view/scheduleView/scheduleDetailView/epics/updateAmountsInScheduleDetailEpic.d.ts +6 -0
  90. package/lib/view/scheduleView/scheduleDetailView/epics/updateAmountsInScheduleDetailEpic.js +29 -0
  91. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.d.ts +18 -0
  92. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.js +185 -0
  93. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.d.ts +58 -0
  94. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +118 -0
  95. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.d.ts +50 -0
  96. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailReducer.js +237 -0
  97. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.d.ts +21 -0
  98. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailSelector.js +67 -0
  99. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.d.ts +47 -0
  100. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailState.js +5 -0
  101. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailTypes.d.ts +3 -0
  102. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailTypes.js +14 -0
  103. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.d.ts +8 -0
  104. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +52 -0
  105. package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.d.ts +27 -0
  106. package/lib/view/scheduleView/scheduleListView/epics/fetchScheduleListEpic.js +75 -0
  107. package/lib/view/scheduleView/scheduleListView/epics/fetchSchedulesAccountEpic.d.ts +19 -0
  108. package/lib/view/scheduleView/scheduleListView/epics/fetchSchedulesAccountEpic.js +37 -0
  109. package/lib/view/scheduleView/scheduleListView/scheduleListHelper.d.ts +70 -0
  110. package/lib/view/scheduleView/scheduleListView/scheduleListHelper.js +187 -0
  111. package/lib/view/scheduleView/scheduleListView/scheduleListPayload.d.ts +7 -0
  112. package/lib/view/scheduleView/scheduleListView/scheduleListPayload.js +2 -0
  113. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +55 -0
  114. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +228 -0
  115. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.d.ts +38 -0
  116. package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +193 -0
  117. package/lib/view/scheduleView/scheduleListView/scheduleListState.d.ts +29 -0
  118. package/lib/view/scheduleView/scheduleListView/scheduleListState.js +2 -0
  119. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +22 -0
  120. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.js +39 -0
  121. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +2 -1
  122. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.js +10 -1
  123. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +6 -0
  124. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +13 -1
  125. package/lib/view/spendManagement/helpers.d.ts +2 -0
  126. package/lib/view/spendManagement/helpers.js +12 -1
  127. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailReducer.js +1 -1
  128. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +2 -2
  129. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailState.d.ts +2 -2
  130. package/lib/view/spendManagement/zeniAccounts/transferDetail/transferMoneyEpic.js +3 -2
  131. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  132. package/lib/view/topEx/topExSelector.d.ts +1 -1
  133. package/lib/view/transactionDetail/epics/initializeTransactionDetailLocalDataEpic.js +2 -5
  134. package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +2 -1
  135. package/lib/view/transactionDetail/epics/transactionDetailEpic.js +3 -2
  136. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +2 -1
  137. package/lib/view/transactionDetail/transactionDetailSelector.js +3 -2
  138. package/lib/view/transactionDetail/transactionDetailState.d.ts +1 -1
  139. package/lib/view/transactionDetail/transactionDetailState.js +3 -16
  140. package/lib/view/transactionList/transactionListByAccountSelector.js +2 -1
  141. package/lib/view/transactionList/transactionListByCategoryTypeSelector.js +2 -1
  142. package/lib/view/transactionList/transactionListByClassSelector.js +2 -1
  143. package/lib/view/transactionList/transactionListByEntitySelector.js +2 -1
  144. package/lib/view/vendorList/vendorListSelector.d.ts +3 -0
  145. package/lib/view/vendorList/vendorListSelector.js +11 -1
  146. package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +2 -2
  147. package/lib/zeniDayJS.d.ts +1 -0
  148. package/lib/zeniDayJS.js +7 -1
  149. package/package.json +1 -1
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getFetchStateForScheduleAccountList = exports.getScheduleListReport = void 0;
7
+ const get_1 = __importDefault(require("lodash/get"));
8
+ const orderBy_1 = __importDefault(require("lodash/orderBy"));
9
+ const accountListSelector_1 = require("../../accountList/accountListSelector");
10
+ const jeSchedulesSelector_1 = require("../../../entity/jeSchedules/jeSchedulesSelector");
11
+ const scheduleListReducer_1 = require("./scheduleListReducer");
12
+ const scheduleListTypes_1 = require("./scheduleListTypes");
13
+ const amount_1 = require("../../../commonStateTypes/amount");
14
+ const scheduleListHelper_1 = require("./scheduleListHelper");
15
+ const sortedJETransactionsView = (jeTransactions, sortKey, sortOrder) => {
16
+ return (0, orderBy_1.default)(jeTransactions, (jeTransaction) => {
17
+ var _a;
18
+ switch (sortKey) {
19
+ case 'transactionDate':
20
+ return jeTransaction.baseTransaction.date.valueOf();
21
+ case 'vendor':
22
+ return jeTransaction.vendor.name.toLowerCase();
23
+ case 'scheduleCategory':
24
+ return jeTransaction.baseTransaction.account.accountName.toLowerCase();
25
+ case 'expenseCategory':
26
+ return jeTransaction.jeDebit.account != null
27
+ ? jeTransaction.jeDebit.account.accountName.toLowerCase()
28
+ : null;
29
+ case 'class':
30
+ return jeTransaction.jeDebit.accountingClass != null
31
+ ? jeTransaction.jeDebit.accountingClass.className.toLowerCase()
32
+ : null;
33
+ case 'amount':
34
+ return jeTransaction.baseTransaction.amount != null
35
+ ? jeTransaction.baseTransaction.amount.amount
36
+ : 0;
37
+ case 'balanceAsOfToday':
38
+ return jeTransaction.balanceAsOfToday != null
39
+ ? jeTransaction.balanceAsOfToday.amount
40
+ : 0;
41
+ case 'memo':
42
+ return jeTransaction.baseTransaction.memo.toLowerCase();
43
+ case 'startMonth':
44
+ return jeTransaction.startDate != null
45
+ ? jeTransaction.startDate.valueOf()
46
+ : null;
47
+ case 'endMonth':
48
+ return jeTransaction.endDate != null
49
+ ? jeTransaction.endDate.valueOf()
50
+ : null;
51
+ case 'months':
52
+ return (_a = jeTransaction.period) !== null && _a !== void 0 ? _a : null;
53
+ case 'transactionType':
54
+ return jeTransaction.baseTransaction.type.toLowerCase();
55
+ case 'status':
56
+ return jeTransaction.status.code.toLowerCase();
57
+ default:
58
+ return jeTransaction.updatedByUser != null
59
+ ? jeTransaction.updatedByUser.firstName.toLowerCase()
60
+ : null;
61
+ }
62
+ }, sortOrder === 'ascending' ? 'asc' : 'desc');
63
+ };
64
+ const getScheduleListReport = (state) => {
65
+ const { scheduleListState, accountListState, accountState } = state;
66
+ const downloadState = scheduleListState.downloadState;
67
+ const key = (0, scheduleListTypes_1.getScheduleListKey)(scheduleListState.currentTab, scheduleListState.selectedCategoryId, scheduleListState.selectedTimeframe);
68
+ const scheduleListRecord = (0, get_1.default)(scheduleListState.byScheduleListKey, key, undefined);
69
+ const allScheduleAccounts = (0, accountListSelector_1.getAccountList)(accountState, accountListState, (0, scheduleListHelper_1.getAccountListKeyForSchedulesTab)(scheduleListState.currentTab));
70
+ let allNestedAccounts = (0, accountListSelector_1.getNestedAccountListHeirarchy)(accountListState, (0, scheduleListHelper_1.getAccountListKeyForSchedulesTab)(scheduleListState.currentTab));
71
+ let allAccounts = allScheduleAccounts.accounts;
72
+ if (scheduleListState.currentTab === 'prepaid_expenses') {
73
+ const filteredList = (0, accountListSelector_1.getFilteredNestedAndAccountListsForLabel)(accountState, accountListState, (0, scheduleListHelper_1.getAccountListKeyForSchedulesTab)(scheduleListState.currentTab), 'prepaid_expenses');
74
+ // Use this list only if there is some account in it.
75
+ if (filteredList.accountList.length > 0) {
76
+ allAccounts = filteredList.accountList;
77
+ allNestedAccounts = filteredList.nestedAccountList;
78
+ }
79
+ }
80
+ if (scheduleListRecord == null) {
81
+ return {
82
+ reportTitle: 'Schedule List',
83
+ version: 1,
84
+ status: undefined,
85
+ jeScheduleOrder: 'descending_transaction_date',
86
+ jeScheduledTransactions: [],
87
+ currentTab: scheduleListState.currentTab,
88
+ currentSubTab: scheduleListState.currentSubTab,
89
+ selectedScheduledId: undefined,
90
+ downloadUIState: downloadState,
91
+ searchText: '',
92
+ selectedCategoryID: scheduleListState.scheduleListLocalData.selectedCategoryID,
93
+ selectedTimeframe: scheduleListState.scheduleListLocalData.selectedTimeframe,
94
+ allSubTabs: scheduleListTypes_1.ALL_SCHEDULES_SUB_TABS.map((subTab) => subTab),
95
+ uiState: scheduleListReducer_1.scheduleListInitialState.uiState,
96
+ scheduleListAccounts: [(0, scheduleListHelper_1.getAllAccountBase)(), ...allAccounts],
97
+ scheduleListNestedAccountHierarchy: [
98
+ (0, scheduleListHelper_1.getAllAccountNested)(),
99
+ ...allNestedAccounts,
100
+ ],
101
+ fetchState: 'Not-Started',
102
+ error: undefined,
103
+ scheduleListLocalData: scheduleListState.scheduleListLocalData,
104
+ allTimeframeTicks: [],
105
+ totalBalanceTimeframeTicks: {
106
+ months: [],
107
+ },
108
+ totalAmount: (0, amount_1.toAmount)(0, '', ''),
109
+ totalRunningBalances: (0, amount_1.toAmount)(0, '', ''),
110
+ };
111
+ }
112
+ else {
113
+ const jeScheduleIds = scheduleListRecord.jeScheduleTransactionKeys;
114
+ const { uiState, selectedScheduleId, fetchState, error } = scheduleListRecord;
115
+ const { sortKey, sortOrder } = uiState;
116
+ const scheduleTransactionsUnsorted = jeScheduleIds
117
+ .map((jeScheduleId) => (0, jeSchedulesSelector_1.getJEScheduledTransactionByJEScheduleKey)(jeScheduleId, state))
118
+ .filter((value) => {
119
+ if (value == null) {
120
+ console.error("Can't have null transaction at this stage!");
121
+ }
122
+ return value != null;
123
+ });
124
+ const currentTabTransactions = (0, orderBy_1.default)(scheduleTransactionsUnsorted, (value) => value.baseTransaction.date.valueOf(), 'desc');
125
+ let jeTransactionsView = [];
126
+ switch (scheduleListState.currentTab) {
127
+ case 'prepaid_expenses':
128
+ switch (scheduleListState.currentSubTab) {
129
+ case 'new':
130
+ jeTransactionsView = currentTabTransactions.filter((tran) => tran.status.code === 'new');
131
+ break;
132
+ case 'ongoing':
133
+ jeTransactionsView = currentTabTransactions.filter((tran) => tran.status.code === 'ongoing');
134
+ break;
135
+ case 'completed':
136
+ jeTransactionsView = currentTabTransactions.filter((tran) => tran.status.code === 'completed');
137
+ break;
138
+ default:
139
+ jeTransactionsView = currentTabTransactions;
140
+ }
141
+ break;
142
+ }
143
+ const loweredSearchText = scheduleListState.searchText.trim().toLowerCase();
144
+ const sortedJETransactionView = sortedJETransactionsView(jeTransactionsView.filter((jeTransaction) => {
145
+ return (jeTransaction.vendor.name
146
+ .toLowerCase()
147
+ .includes(loweredSearchText) === true ||
148
+ jeTransaction.baseTransaction.memo
149
+ .toLowerCase()
150
+ .includes(loweredSearchText) === true);
151
+ }), sortKey, sortOrder);
152
+ const totalBalances = (0, scheduleListHelper_1.getCalculatedScheduleTotals)(jeTransactionsView);
153
+ const allTimeframeTicks = (0, scheduleListHelper_1.getAllTimeframeTicks)(sortedJETransactionView, 2);
154
+ const jeScheduledTransactionWithBalance = [];
155
+ sortedJETransactionView.forEach((jeSchedule) => {
156
+ jeScheduledTransactionWithBalance.push(Object.assign(Object.assign({}, jeSchedule), { coaBalanceByPeriod: (0, scheduleListHelper_1.calculateCOABalanceGroupedByPeriod)(jeSchedule) }));
157
+ });
158
+ const totalBalanceTimeframeTicks = (0, scheduleListHelper_1.calculateTotalBalanceTimeframeTick)(jeScheduledTransactionWithBalance, allTimeframeTicks, 'months');
159
+ return {
160
+ reportTitle: 'Schedule List',
161
+ version: 1,
162
+ status: undefined,
163
+ jeScheduleOrder: 'descending_transaction_date',
164
+ jeScheduledTransactions: jeScheduledTransactionWithBalance,
165
+ currentTab: scheduleListState.currentTab,
166
+ currentSubTab: scheduleListState.currentSubTab,
167
+ selectedScheduledId: selectedScheduleId,
168
+ downloadUIState: downloadState,
169
+ searchText: scheduleListState.searchText,
170
+ selectedCategoryID: scheduleListState.selectedCategoryId,
171
+ selectedTimeframe: scheduleListState.selectedTimeframe,
172
+ allSubTabs: scheduleListTypes_1.ALL_SCHEDULES_SUB_TABS.map((subTab) => subTab),
173
+ uiState,
174
+ scheduleListAccounts: [(0, scheduleListHelper_1.getAllAccountBase)(), ...allAccounts],
175
+ scheduleListNestedAccountHierarchy: [
176
+ (0, scheduleListHelper_1.getAllAccountNested)(),
177
+ ...allNestedAccounts,
178
+ ],
179
+ fetchState,
180
+ error,
181
+ scheduleListLocalData: scheduleListState.scheduleListLocalData,
182
+ totalAmount: totalBalances.totalAmount,
183
+ totalRunningBalances: totalBalances.totalRunningBalances,
184
+ allTimeframeTicks,
185
+ totalBalanceTimeframeTicks,
186
+ };
187
+ }
188
+ };
189
+ exports.getScheduleListReport = getScheduleListReport;
190
+ const getFetchStateForScheduleAccountList = (state, scheduleTab) => {
191
+ return (0, accountListSelector_1.getAccountListFetchState)(state.accountListState, (0, scheduleListHelper_1.getAccountListKeyForSchedulesTab)(scheduleTab));
192
+ };
193
+ exports.getFetchStateForScheduleAccountList = getFetchStateForScheduleAccountList;
@@ -0,0 +1,29 @@
1
+ import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
+ import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
3
+ import { TimeframeTick } from '../../../commonStateTypes/timeframeTick';
4
+ import { JEScheduleKey, SchedulesTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
5
+ import { ScheduleListKey, ScheduleSubTabType, ScheduleListSortKey } from './scheduleListTypes';
6
+ export interface ScheduleListUIState {
7
+ sortKey: ScheduleListSortKey;
8
+ sortOrder: SortOrder;
9
+ scrollYOffset: number;
10
+ }
11
+ export interface ScheduleWithListStatus extends FetchedState {
12
+ jeScheduleTransactionKeys: JEScheduleKey[];
13
+ uiState: ScheduleListUIState;
14
+ selectedScheduleId?: ID;
15
+ }
16
+ export interface ScheduleListLocalData {
17
+ selectedCategoryID: ID;
18
+ selectedTimeframe: TimeframeTick;
19
+ }
20
+ export interface ScheduleListViewState {
21
+ byScheduleListKey: Record<ScheduleListKey, ScheduleWithListStatus>;
22
+ downloadState: FetchStateAndError;
23
+ searchText: string;
24
+ currentTab: SchedulesTypes;
25
+ currentSubTab: ScheduleSubTabType;
26
+ selectedCategoryId: ID;
27
+ selectedTimeframe: TimeframeTick;
28
+ scheduleListLocalData: ScheduleListLocalData;
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { ID } from '../../../commonStateTypes/common';
2
+ import { TimeframeTick } from '../../../commonStateTypes/timeframeTick';
3
+ import { SchedulesTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
+ export declare const ALL_SCHEDULE_LIST_TABS_FILE_TYPES: readonly ["excel"];
5
+ export declare const toScheduleListTabsFileTypeStrict: (v?: string | undefined) => "excel" | undefined;
6
+ export declare type ScheduleListTabsFileType = NonNullable<ReturnType<typeof toScheduleListTabsFileTypeStrict>>;
7
+ export declare const getScheduleListKey: (tab: SchedulesTypes, selectedCategory: ID, selectedTimeframe: TimeframeTick) => `prepaid_expenses-${string}-${string}--${string}` | `fixed_assets-${string}-${string}--${string}` | `accured_expenses-${string}-${string}--${string}` | `deferred_revenue-${string}-${string}--${string}`;
8
+ export declare type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
9
+ export declare const ALL_SCHEDULES_SUB_TABS: readonly ["all", "new", "ongoing", "completed"];
10
+ export declare const toScheduleSubTabType: (v: string) => "all" | "new" | "completed" | "ongoing";
11
+ export declare type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
12
+ export declare const ALL_SCHEDULES_PAY_SORT_KEYS: readonly ["transactionDate", "vendor", "scheduleCategory", "expenseCategory", "class", "amount", "balanceAsOfToday", "memo", "startMonth", "endMonth", "months", "transactionType", "status", "user"];
13
+ export declare const toScheduleSortKeyType: (v: string) => "status" | "user" | "months" | "amount" | "vendor" | "class" | "memo" | "transactionDate" | "scheduleCategory" | "expenseCategory" | "balanceAsOfToday" | "startMonth" | "endMonth" | "transactionType";
14
+ export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
15
+ export interface DownloadJEScheduleTabOptions {
16
+ timezone: string;
17
+ tabsFileType: ScheduleListTabsFileType;
18
+ tabs: SchedulesTypes[];
19
+ categoryId: ID;
20
+ timeframe: TimeframeTick;
21
+ searchText?: string;
22
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toScheduleSortKeyType = exports.ALL_SCHEDULES_PAY_SORT_KEYS = exports.toScheduleSubTabType = exports.ALL_SCHEDULES_SUB_TABS = exports.getScheduleListKey = exports.toScheduleListTabsFileTypeStrict = exports.ALL_SCHEDULE_LIST_TABS_FILE_TYPES = void 0;
4
+ const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
5
+ const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
6
+ exports.ALL_SCHEDULE_LIST_TABS_FILE_TYPES = ['excel'];
7
+ const toScheduleListTabsFileTypeStrict = (v) => {
8
+ var _a;
9
+ return (0, stringToUnion_1.stringToUnionStrict)((_a = v === null || v === void 0 ? void 0 : v.toLocaleLowerCase()) !== null && _a !== void 0 ? _a : '', exports.ALL_SCHEDULE_LIST_TABS_FILE_TYPES);
10
+ };
11
+ exports.toScheduleListTabsFileTypeStrict = toScheduleListTabsFileTypeStrict;
12
+ const getScheduleListKey = (tab, selectedCategory, selectedTimeframe) => `${tab}-${selectedCategory}-${selectedTimeframe.startDate.format(formatZeniDateFY_1.DAY_MONTH_YEAR_FORMAT)}--${selectedTimeframe.endDate.format(formatZeniDateFY_1.DAY_MONTH_YEAR_FORMAT)}`;
13
+ exports.getScheduleListKey = getScheduleListKey;
14
+ exports.ALL_SCHEDULES_SUB_TABS = [
15
+ 'all',
16
+ 'new',
17
+ 'ongoing',
18
+ 'completed',
19
+ ];
20
+ const toScheduleSubTabType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_SCHEDULES_SUB_TABS);
21
+ exports.toScheduleSubTabType = toScheduleSubTabType;
22
+ exports.ALL_SCHEDULES_PAY_SORT_KEYS = [
23
+ 'transactionDate',
24
+ 'vendor',
25
+ 'scheduleCategory',
26
+ 'expenseCategory',
27
+ 'class',
28
+ 'amount',
29
+ 'balanceAsOfToday',
30
+ 'memo',
31
+ 'startMonth',
32
+ 'endMonth',
33
+ 'months',
34
+ 'transactionType',
35
+ 'status',
36
+ 'user',
37
+ ];
38
+ const toScheduleSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_SCHEDULES_PAY_SORT_KEYS);
39
+ exports.toScheduleSortKeyType = toScheduleSortKeyType;
@@ -3,7 +3,7 @@ import { Currency } from '../../../../commonStateTypes/amount';
3
3
  import { AccountBasePayload } from '../../../../entity/account/accountPayload';
4
4
  import { ClassBasePayload } from '../../../../entity/class/classPayload';
5
5
  import { ZeniAPIResponse } from '../../../../responsePayload';
6
- import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType, InternationalFee, VendorCurrency, PaymentAchSubConfigCodeType, InternationalSubConfigCodeType, BillPayConfig, InternationalWireMethodCodeType, InternationalWireMethodCodeKeyType, InternationalSubConfigCodeKeyType, BillPaymentSubConfigCodeKeyType, PaymentAchSubConfigCodeKeyType, BillPaymentWireSubConfigCodeType, BillPaymentWireSubConfigCodeKeyType, ConfigPeriod } from './billPayConfigState';
6
+ import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType, InternationalFee, VendorCurrency, PaymentAchSubConfigCodeType, InternationalSubConfigCodeType, BillPayConfig, InternationalWireMethodCodeType, InternationalWireMethodCodeKeyType, InternationalSubConfigCodeKeyType, BillPaymentSubConfigCodeKeyType, PaymentAchSubConfigCodeKeyType, BillPaymentWireSubConfigCodeType, BillPaymentWireSubConfigCodeKeyType, ConfigPeriod, AccountTypeSubConfigCodeKeyType, AccType } from './billPayConfigState';
7
7
  export interface BillPayConfigPayload {
8
8
  bill_pay_bot_email: string;
9
9
  is_us_domestic_wire_enabled: boolean;
@@ -94,6 +94,7 @@ export declare const getPaymentAchSubConfigCodeKey: (subCode: PaymentAchSubConfi
94
94
  export declare const getBillPaymentWireSubConfigCodeKey: (subCode: BillPaymentWireSubConfigCodeType) => BillPaymentWireSubConfigCodeKeyType;
95
95
  export declare const getInternationalSubConfigCodeKey: (subCode: InternationalSubConfigCodeType) => InternationalSubConfigCodeKeyType;
96
96
  export declare const getInternationalWireMethodCodeKey: (subCode: InternationalWireMethodCodeType) => InternationalWireMethodCodeKeyType;
97
+ export declare const getAccountTypeSubConfigCodeKey: (subCode: AccType) => AccountTypeSubConfigCodeKeyType;
97
98
  export interface FeeAmount {
98
99
  amount: number;
99
100
  currencyCode: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toVendorCurrency = exports.mapBillPayVendorConfigPayloadToBillPayVendorConfig = exports.getCurrencies = exports.mapFeePayloadToInternationalLocalAmountFeeAmount = exports.mapBillPayConfigPayloadToBillPayConfig = exports.getClassDetail = exports.getAccountDetail = exports.getTimelineDetail = exports.getFeeDetail = exports.getInternationalWireMethodCodeKey = exports.getInternationalSubConfigCodeKey = exports.getBillPaymentWireSubConfigCodeKey = exports.getPaymentAchSubConfigCodeKey = exports.getBillPaymentSubConfigCodeKey = exports.getSubCodePayload = void 0;
3
+ exports.toVendorCurrency = exports.mapBillPayVendorConfigPayloadToBillPayVendorConfig = exports.getCurrencies = exports.mapFeePayloadToInternationalLocalAmountFeeAmount = exports.mapBillPayConfigPayloadToBillPayConfig = exports.getClassDetail = exports.getAccountDetail = exports.getTimelineDetail = exports.getFeeDetail = exports.getAccountTypeSubConfigCodeKey = exports.getInternationalWireMethodCodeKey = exports.getInternationalSubConfigCodeKey = exports.getBillPaymentWireSubConfigCodeKey = exports.getPaymentAchSubConfigCodeKey = exports.getBillPaymentSubConfigCodeKey = exports.getSubCodePayload = void 0;
4
4
  const amount_1 = require("../../../../commonStateTypes/amount");
5
5
  const accountPayload_1 = require("../../../../entity/account/accountPayload");
6
6
  const classPayload_1 = require("../../../../entity/class/classPayload");
@@ -63,6 +63,15 @@ const getInternationalWireMethodCodeKey = (subCode) => {
63
63
  }
64
64
  };
65
65
  exports.getInternationalWireMethodCodeKey = getInternationalWireMethodCodeKey;
66
+ const getAccountTypeSubConfigCodeKey = (subCode) => {
67
+ switch (subCode) {
68
+ case 'deposit_account':
69
+ return 'depositAccount';
70
+ case 'payment_account':
71
+ return 'paymentAccount';
72
+ }
73
+ };
74
+ exports.getAccountTypeSubConfigCodeKey = getAccountTypeSubConfigCodeKey;
66
75
  const getFeeDetail = (fees, code, subCode, internationalMethod, internationalSubMethod) => {
67
76
  let feeAmount = {
68
77
  amount: 0,
@@ -80,6 +80,12 @@ export declare type BillPaymentSubConfigCodeType = PaymentAchSubConfigCodeType |
80
80
  export declare type BillPaymentSubConfigCodeKeyType = PaymentAchSubConfigCodeKeyType | BillPaymentWireSubConfigCodeKeyType;
81
81
  export declare const toBillPaymentSubConfigCodeKeyType: (v: string) => BillPaymentSubConfigCodeKeyType;
82
82
  export declare const toBillPaymentSubConfigCodeType: (v: string) => BillPaymentSubConfigCodeType;
83
+ export declare const ACCOUNT_TYPE_CODES: readonly ["deposit_account", "payment_account"];
84
+ export declare const toAccType: (v: string) => "deposit_account" | "payment_account";
85
+ export declare type AccType = ReturnType<typeof toAccType>;
86
+ export declare const ACCOUNT_TYPE_SUB_CODES_KEYS: readonly ["depositAccount", "paymentAccount"];
87
+ export declare const toAccountTypeSubConfigCodeKeyType: (v: string) => "depositAccount" | "paymentAccount";
88
+ export declare type AccountTypeSubConfigCodeKeyType = ReturnType<typeof toAccountTypeSubConfigCodeKeyType>;
83
89
  export declare const BILL_NEW_PAYMENT_METHODS: string[];
84
90
  export declare const NEW_INTERNATIONAL_METHOD_SUBTEXT = "billPay_wire_international";
85
91
  export declare const SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = "swiftOur";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.toInternationalSubMethodCodeKeyType = exports.INTERNATIONAL_SUB_CODES_KEYS = exports.toInternationalSubMethodCodeType = exports.INTERNATIONAL_SUB_CODES = exports.toInternationalWireMethodCodeKeyType = exports.INTERNATIONAL_CODES_KEYS = exports.toInternationalWireMethodCodeType = exports.INTERNATIONAL_CODES = exports.toBillPaymentWireSubMethodCodeKeyType = exports.BILL_PAYMENT_WIRE_SUB_CODES_KEYS = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeKeyType = exports.PAYMENT_ACH_SUB_CODES_KEYS = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.DYNAMIC_FEE_TYPE = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
3
+ exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toAccountTypeSubConfigCodeKeyType = exports.ACCOUNT_TYPE_SUB_CODES_KEYS = exports.toAccType = exports.ACCOUNT_TYPE_CODES = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.toInternationalSubMethodCodeKeyType = exports.INTERNATIONAL_SUB_CODES_KEYS = exports.toInternationalSubMethodCodeType = exports.INTERNATIONAL_SUB_CODES = exports.toInternationalWireMethodCodeKeyType = exports.INTERNATIONAL_CODES_KEYS = exports.toInternationalWireMethodCodeType = exports.INTERNATIONAL_CODES = exports.toBillPaymentWireSubMethodCodeKeyType = exports.BILL_PAYMENT_WIRE_SUB_CODES_KEYS = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeKeyType = exports.PAYMENT_ACH_SUB_CODES_KEYS = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.DYNAMIC_FEE_TYPE = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
4
4
  const common_1 = require("../../../../commonStateTypes/common");
5
5
  const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
6
6
  const getBillPayConfigKey = (method, subMethod) => {
@@ -68,6 +68,18 @@ const toBillPaymentSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUni
68
68
  exports.toBillPaymentSubConfigCodeKeyType = toBillPaymentSubConfigCodeKeyType;
69
69
  const toBillPaymentSubConfigCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, [...exports.PAYMENT_ACH_SUB_CODES, ...exports.BILL_PAYMENT_WIRE_SUB_CODES]);
70
70
  exports.toBillPaymentSubConfigCodeType = toBillPaymentSubConfigCodeType;
71
+ exports.ACCOUNT_TYPE_CODES = [
72
+ 'deposit_account',
73
+ 'payment_account',
74
+ ];
75
+ const toAccType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ACCOUNT_TYPE_CODES);
76
+ exports.toAccType = toAccType;
77
+ exports.ACCOUNT_TYPE_SUB_CODES_KEYS = [
78
+ 'depositAccount',
79
+ 'paymentAccount',
80
+ ];
81
+ const toAccountTypeSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ACCOUNT_TYPE_SUB_CODES_KEYS);
82
+ exports.toAccountTypeSubConfigCodeKeyType = toAccountTypeSubConfigCodeKeyType;
71
83
  //These const are used in web-components
72
84
  exports.BILL_NEW_PAYMENT_METHODS = [
73
85
  'billPay_ach_sameDay',
@@ -4,6 +4,7 @@ import { RemiActivity } from './reimbursement/remiDetailView/remiDetailViewSelec
4
4
  import { BusinessVerificationDetails, CompanyOfficersDetails } from './commonSetup/setupViewSelector';
5
5
  import { RecurringBillConfigLocalData, RecurringBillInstance } from './billPay/editBillView/editBillViewState';
6
6
  import { RecurringBillConfig, RecurringBillFrequency } from '../../entity/billPay/recurringBills/recurringBillsState';
7
+ import { AccType } from './billPay/billPayConfig/billPayConfigState';
7
8
  export declare const getLatestApprovalDate: (allActivities: BillActivity[] | RemiActivity[]) => ZeniDate | undefined;
8
9
  export declare function getSpendManagementEffectiveListPeriod(): import("../..").TimePeriod;
9
10
  export declare const getSelectedCompanyOfficer: (verificationDetails: BusinessVerificationDetails) => CompanyOfficersDetails | undefined;
@@ -15,3 +16,4 @@ export declare const updateRecurringBillDetails: (currentRecurringConfig: Recurr
15
16
  export declare const isRecurringConfigChanged: (recurringBillNewConfig: RecurringBillConfigLocalData, originalRecurringBillConfig: Partial<RecurringBillConfig>, checkApprovalChange: boolean) => boolean;
16
17
  export declare const getTotalPayments: (startDate: ZeniDate, endDate: ZeniDate, frequency: RecurringBillFrequency, currentInstance?: RecurringBillInstance | undefined) => number;
17
18
  export declare const getEndDate: (startDate: ZeniDate, frequency: RecurringBillFrequency, totalPayments: number, currentInstance?: RecurringBillInstance | undefined) => ZeniDate;
19
+ export declare const accountTypeSubConfigCodeToAccType: (code?: "depositAccount" | "paymentAccount" | undefined) => AccType | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEndDate = exports.getTotalPayments = exports.isRecurringConfigChanged = exports.updateRecurringBillDetails = exports.getPaymentDateFromVendorReceiveDate = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getLatestApprovalDate = void 0;
3
+ exports.accountTypeSubConfigCodeToAccType = exports.getEndDate = exports.getTotalPayments = exports.isRecurringConfigChanged = exports.updateRecurringBillDetails = exports.getPaymentDateFromVendorReceiveDate = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getLatestApprovalDate = void 0;
4
4
  const timeframeTick_1 = require("../../commonStateTypes/timeframeTick");
5
5
  const workingDayHelper_1 = require("../../commonStateTypes/workingDayHelper");
6
6
  const zeniDayJS_1 = require("../../zeniDayJS");
@@ -176,3 +176,14 @@ function checkIfHolidayAndGetNextDate(date) {
176
176
  }
177
177
  return { vendorReceiveDate: date, vendorReceiveDateNotes: '' };
178
178
  }
179
+ const accountTypeSubConfigCodeToAccType = (code) => {
180
+ switch (code) {
181
+ case 'depositAccount':
182
+ return 'deposit_account';
183
+ case 'paymentAccount':
184
+ return 'payment_account';
185
+ default:
186
+ return undefined;
187
+ }
188
+ };
189
+ exports.accountTypeSubConfigCodeToAccType = accountTypeSubConfigCodeToAccType;
@@ -38,7 +38,7 @@ const transferDetail = (0, toolkit_1.createSlice)({
38
38
  updateTransferToLocalData(draft, action) {
39
39
  const transferMoneyParty = {
40
40
  id: action.payload.id,
41
- accType: 'deposit_account',
41
+ accType: 'depositAccount',
42
42
  label: action.payload.accountName,
43
43
  maskedAccountNumber: action.payload.maskedAccountNumber,
44
44
  accountBalance: action.payload.accountBalance,
@@ -20,7 +20,7 @@ const getTransferDetail = (state) => {
20
20
  transferParties = [
21
21
  ...depositAccountsView.depositAccounts.map((depositAcc) => ({
22
22
  id: depositAcc.id,
23
- accType: 'deposit_account',
23
+ accType: 'depositAccount',
24
24
  label: depositAcc.accountName,
25
25
  maskedAccountNumber: depositAcc.maskedAccountNumber,
26
26
  accountBalance: depositAcc.accountBalance,
@@ -37,7 +37,7 @@ const getTransferDetail = (state) => {
37
37
  var _a;
38
38
  return ({
39
39
  id: paymentAcc.paymentAccountId,
40
- accType: 'payment_account',
40
+ accType: 'paymentAccount',
41
41
  maskedAccountNumber: paymentAcc.maskedAccountNumber,
42
42
  label: Boolean(paymentAcc.institutionDetails.institutionName) === true
43
43
  ? paymentAcc.institutionDetails.institutionName
@@ -2,6 +2,7 @@ import { Amount } from '../../../../commonStateTypes/amount';
2
2
  import { Balance } from '../../../../commonStateTypes/balance';
3
3
  import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
4
4
  import { Logo } from '../../../../entity/paymentAccount/paymentAccountState';
5
+ import { AccountTypeSubConfigCodeKeyType } from '../../billPay/billPayConfig/billPayConfigState';
5
6
  export interface TransferDetailState extends FetchStateAndError {
6
7
  localData: TransferDetailLocalData;
7
8
  }
@@ -12,10 +13,9 @@ export interface TransferDetailLocalData {
12
13
  }
13
14
  export interface TransferMoneyParty {
14
15
  id: ID;
15
- accType: AccType;
16
+ accType: AccountTypeSubConfigCodeKeyType;
16
17
  label: string;
17
18
  maskedAccountNumber: string;
18
19
  accountBalance?: Balance;
19
20
  logo?: Logo;
20
21
  }
21
- export declare type AccType = 'deposit_account' | 'payment_account';
@@ -7,6 +7,7 @@ const responsePayload_1 = require("../../../../responsePayload");
7
7
  const transferDetailReducer_1 = require("./transferDetailReducer");
8
8
  const depositAccountListReducer_1 = require("../depositAccountList/depositAccountListReducer");
9
9
  const depositAccountTransactionListReducer_1 = require("../depositAccountTransactionList/depositAccountTransactionListReducer");
10
+ const helpers_1 = require("../../helpers");
10
11
  const transferMoneyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transferDetailReducer_1.transferMoney.match), (0, operators_1.switchMap)((action) => {
11
12
  var _a, _b, _c, _d;
12
13
  const state = state$.value;
@@ -15,11 +16,11 @@ const transferMoneyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, opera
15
16
  const payload = {
16
17
  from_account: {
17
18
  account_id: (_a = localData.transferFrom) === null || _a === void 0 ? void 0 : _a.id,
18
- account_type: (_b = localData.transferFrom) === null || _b === void 0 ? void 0 : _b.accType,
19
+ account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((_b = localData.transferFrom) === null || _b === void 0 ? void 0 : _b.accType),
19
20
  },
20
21
  to_account: {
21
22
  account_id: (_c = localData.transferTo) === null || _c === void 0 ? void 0 : _c.id,
22
- account_type: (_d = localData.transferTo) === null || _d === void 0 ? void 0 : _d.accType,
23
+ account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((_d = localData.transferTo) === null || _d === void 0 ? void 0 : _d.accType),
23
24
  },
24
25
  amount: localData.amount.amount,
25
26
  currency_code: localData.amount.currencyCode,
@@ -1,6 +1,6 @@
1
1
  import { RootState } from '../../reducer';
2
2
  export declare const getTasksCardReport: (state: RootState) => {
3
- reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review";
3
+ reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses";
4
4
  reportTitle: string;
5
5
  version: string | number | undefined;
6
6
  status: import("../..").Status | undefined;
@@ -5,7 +5,7 @@ import { AccountState } from '../../entity/account/accountState';
5
5
  import { EntityOrder } from '../../commonStateTypes/selectorTypes/selectorTypes';
6
6
  import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
7
7
  export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number | undefined) => {
8
- reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review";
8
+ reportId: "cash_balance" | "card_balance" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses";
9
9
  reportTitle: string;
10
10
  version: string | number | undefined;
11
11
  status: import("../..").Status | undefined;
@@ -1,22 +1,19 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.initializeTransactionDetailLocalDataEpic = void 0;
7
4
  const rxjs_1 = require("rxjs");
8
- const get_1 = __importDefault(require("lodash/get"));
9
5
  const operators_1 = require("rxjs/operators");
10
6
  const transactionDetailReducer_1 = require("../transactionDetailReducer");
11
7
  const transactionDetailState_1 = require("../transactionDetailState");
12
8
  const transactionDetailLocalDataHelper_1 = require("../transactionDetailLocalDataHelper");
13
9
  const accountListSelector_1 = require("../../accountList/accountListSelector");
10
+ const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
14
11
  const initializeTransactionDetailLocalDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.initializeTransactionDetailLocalData.match), (0, operators_1.mergeMap)((action) => {
15
12
  const { transactionId, vendorId } = action.payload;
16
13
  const fetchActions = [];
17
14
  const transactionState = state$.value.transactionState;
18
15
  const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
19
- const detail = (0, get_1.default)(transactionState.transactionById, key, undefined);
16
+ const detail = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, key);
20
17
  if (detail != null) {
21
18
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(state$.value.accountState, state$.value.accountListState, 'accountList');
22
19
  const localData = (0, transactionDetailLocalDataHelper_1.toTransactionDetailLocalData)(detail, vendorId, uncategorizedIncomeExpense);
@@ -11,6 +11,7 @@ const transactionDetailReducer_1 = require("../transactionDetailReducer");
11
11
  const transactionDetailState_1 = require("../transactionDetailState");
12
12
  const saveTransactionHelper_1 = require("./saveTransactionHelper");
13
13
  const accountListSelector_1 = require("../../accountList/accountListSelector");
14
+ const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
14
15
  const saveTransactionDetailEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.saveTransactionDetail.match), (0, operators_1.mergeMap)((action) => {
15
16
  const transactionId = action.payload.transactionId;
16
17
  const fetchActions = [];
@@ -18,7 +19,7 @@ const saveTransactionDetailEpic = (actions$, state$) => actions$.pipe((0, operat
18
19
  const transactionState = state$.value.transactionState;
19
20
  const key = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
20
21
  const detail = (0, get_1.default)(transactionDetailState.transactionDetailById, key, undefined);
21
- const transaction = (0, get_1.default)(transactionState.transactionById, key, undefined);
22
+ const transaction = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, key);
22
23
  if (detail != null && transaction != null) {
23
24
  const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(state$.value.accountState, state$.value.accountListState, 'accountList');
24
25
  const localData = detail.transactionDetailLocalData;
@@ -21,12 +21,13 @@ const transactionVendorLocalDataHelper_1 = require("../../commonVendorView/trans
21
21
  const vendorPayload_1 = require("../../../entity/vendor/vendorPayload");
22
22
  const transactionType_1 = require("../../../entity/transaction/stateTypes/transactionType");
23
23
  const ownerListReducer_1 = require("../../ownerList/ownerListReducer");
24
+ const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
24
25
  const fetchTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.fetchTransactionDetail.match), (0, operators_1.mergeMap)((action) => {
25
26
  const { transactionId, cacheOverride } = action.payload;
26
27
  const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
27
28
  const transactionActions = [];
28
29
  if (cacheOverride === true) {
29
- const transaction = (0, get_1.default)(state$.value.transactionState.transactionById, detailKey, undefined);
30
+ const transaction = (0, transactionSelector_1.getSupportedTransactionById)(state$.value.transactionState, detailKey);
30
31
  transactionActions.push(...removeCompleteTransaction(transactionId, transaction));
31
32
  }
32
33
  const transactionDetail = (0, get_1.default)(state$.value.transactionDetailState.transactionDetailById, detailKey, undefined);
@@ -123,7 +124,7 @@ function getAllFetchLinkedTransactionDetailActions(transactionPayload, state) {
123
124
  const linkedTransactionFiltered = linkedTransaction.filter((value) => isTransactionDetailInCacheOrFetching(value, state) === false);
124
125
  linkedTransactionFiltered.forEach((transactionDetailToFetch) => fetchLinkedTransactionActions.push((0, transactionDetailReducer_1.fetchTransactionDetail)(transactionDetailToFetch, false)));
125
126
  if (linkedTransactionFiltered.length === 0) {
126
- console.log('Phew all linked transacitons are fetched or there are no linked transactions..');
127
+ console.log('Phew all linked transactions are fetched or there are no linked transactions..');
127
128
  }
128
129
  return fetchLinkedTransactionActions;
129
130
  }
@@ -24,6 +24,7 @@ const recommendationPayload_1 = require("../../../commonPayloadTypes/recommendat
24
24
  const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
25
25
  const vendorReducer_1 = require("../../../entity/vendor/vendorReducer");
26
26
  const transactionType_1 = require("../../../entity/transaction/stateTypes/transactionType");
27
+ const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
27
28
  const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.updateTransactionDetail.match), (0, operators_1.mergeMap)((action) => {
28
29
  const { transactionState, vendorState, transactionDetailState } = state$.value;
29
30
  return zeniAPI
@@ -112,7 +113,7 @@ const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe
112
113
  exports.updateTransactionDetailEpic = updateTransactionDetailEpic;
113
114
  function preparePayload(transactionState, vendorState, transactionDetailState, transactionId, saveUpdates) {
114
115
  const transactionDetailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
115
- const detail = (0, get_1.default)(transactionState.transactionById, transactionDetailKey, undefined);
116
+ const detail = (0, transactionSelector_1.getSupportedTransactionById)(transactionState, transactionDetailKey);
116
117
  const tranDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, transactionDetailKey, undefined);
117
118
  const tranVendorUpdates = tranDetail === null || tranDetail === void 0 ? void 0 : tranDetail.transactionDetailLocalData.vendorUpdates;
118
119
  let vendorUpdates = undefined;