@zeniai/client-epic-state 4.20.7 → 4.20.9-beta0ND

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 (193) hide show
  1. package/lib/commonStateTypes/coaBalance/additionalBalances/getSummationBalance.d.ts +1 -1
  2. package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +2 -0
  3. package/lib/commonStateTypes/coaBalance/coaBalanceType.js +6 -0
  4. package/lib/commonStateTypes/currencyHelper.d.ts +3 -0
  5. package/lib/commonStateTypes/currencyHelper.js +6 -1
  6. package/lib/commonStateTypes/reduceFetchState.d.ts +9 -0
  7. package/lib/commonStateTypes/reduceFetchState.js +26 -0
  8. package/lib/coreEpics.js +2 -1
  9. package/lib/entity/account/accountPayload.d.ts +2 -0
  10. package/lib/entity/account/accountPayload.js +2 -0
  11. package/lib/entity/account/accountState.d.ts +2 -0
  12. package/lib/entity/customer/customerState.d.ts +0 -2
  13. package/lib/entity/customer/customerState.js +0 -5
  14. package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
  15. package/lib/entity/depositAccount/depositAccount.js +8 -1
  16. package/lib/entity/reimbursement/reimbursementPayload.d.ts +2 -0
  17. package/lib/entity/reimbursement/reimbursementPayload.js +7 -0
  18. package/lib/entity/reimbursement/reimbursementState.d.ts +2 -0
  19. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  20. package/lib/entity/snackbar/snackbarTypes.js +2 -0
  21. package/lib/entity/task/taskPayload.d.ts +1 -0
  22. package/lib/entity/task/taskPayload.js +1 -0
  23. package/lib/entity/task/taskState.d.ts +1 -0
  24. package/lib/entity/tenant/SessionManager.d.ts +38 -0
  25. package/lib/entity/tenant/SessionManager.js +171 -0
  26. package/lib/entity/tenant/epic/sessionHeartbeatEpic.d.ts +16 -0
  27. package/lib/entity/tenant/epic/sessionHeartbeatEpic.js +16 -0
  28. package/lib/entity/tenant/sessionTypes.d.ts +26 -0
  29. package/lib/entity/tenant/sessionTypes.js +12 -0
  30. package/lib/entity/tenant/tenantReducer.d.ts +5 -1
  31. package/lib/entity/tenant/tenantReducer.js +23 -2
  32. package/lib/entity/tenant/tenantState.d.ts +1 -0
  33. package/lib/entity/userGroups/userGroupsPayload.d.ts +7 -0
  34. package/lib/entity/userGroups/userGroupsPayload.js +10 -0
  35. package/lib/entity/userGroups/userGroupsReducer.d.ts +8 -0
  36. package/lib/entity/userGroups/userGroupsReducer.js +29 -0
  37. package/lib/entity/userGroups/userGroupsSelector.d.ts +4 -0
  38. package/lib/entity/userGroups/userGroupsSelector.js +12 -0
  39. package/lib/entity/userGroups/userGroupsState.d.ts +9 -0
  40. package/lib/entity/userGroups/userGroupsState.js +2 -0
  41. package/lib/epic.d.ts +15 -1
  42. package/lib/epic.js +15 -1
  43. package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +5 -0
  44. package/lib/esm/commonStateTypes/currencyHelper.js +5 -0
  45. package/lib/esm/commonStateTypes/reduceFetchState.js +25 -0
  46. package/lib/esm/coreEpics.js +2 -1
  47. package/lib/esm/entity/account/accountPayload.js +2 -0
  48. package/lib/esm/entity/customer/customerState.js +1 -4
  49. package/lib/esm/entity/depositAccount/depositAccount.js +8 -1
  50. package/lib/esm/entity/reimbursement/reimbursementPayload.js +7 -0
  51. package/lib/esm/entity/snackbar/snackbarTypes.js +2 -0
  52. package/lib/esm/entity/task/taskPayload.js +1 -0
  53. package/lib/esm/entity/tenant/SessionManager.js +167 -0
  54. package/lib/esm/entity/tenant/epic/sessionHeartbeatEpic.js +12 -0
  55. package/lib/esm/entity/tenant/sessionTypes.js +9 -0
  56. package/lib/esm/entity/tenant/tenantReducer.js +21 -1
  57. package/lib/esm/entity/userGroups/userGroupsPayload.js +7 -0
  58. package/lib/esm/entity/userGroups/userGroupsReducer.js +25 -0
  59. package/lib/esm/entity/userGroups/userGroupsSelector.js +8 -0
  60. package/lib/esm/entity/userGroups/userGroupsState.js +1 -0
  61. package/lib/esm/epic.js +15 -1
  62. package/lib/esm/index.js +24 -12
  63. package/lib/esm/reducer.js +6 -0
  64. package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
  65. package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
  66. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
  67. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +29 -0
  68. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
  69. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
  70. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +49 -0
  71. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
  72. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +33 -0
  73. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +56 -0
  74. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
  75. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
  76. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +71 -0
  77. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  78. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +86 -0
  79. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
  80. package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
  81. package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
  82. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +198 -1
  83. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +456 -2
  84. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +23 -1
  85. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +246 -1
  86. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  87. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +44 -0
  88. package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  89. package/lib/esm/view/financeStatement/financeStatementReducer.js +11 -8
  90. package/lib/esm/view/financeStatement/financeStatementSelector.js +24 -9
  91. package/lib/esm/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +17 -0
  92. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +331 -0
  93. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +9 -0
  94. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
  95. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
  96. package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
  97. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +262 -0
  98. package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +9 -7
  99. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  100. package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
  101. package/lib/esm/view/taskManager/taskListView/taskListSelector.js +3 -1
  102. package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +65 -0
  103. package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +16 -0
  104. package/lib/esm/view/userGroupListView/userGroupListViewState.js +1 -0
  105. package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +11 -0
  106. package/lib/esm/zeniAPI.js +0 -2
  107. package/lib/index.d.ts +25 -14
  108. package/lib/index.js +100 -31
  109. package/lib/reducer.d.ts +6 -0
  110. package/lib/reducer.js +6 -0
  111. package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
  112. package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
  113. package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
  114. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
  115. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
  116. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +18 -0
  117. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +33 -0
  118. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
  119. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
  120. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
  121. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
  122. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
  123. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +53 -0
  124. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
  125. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
  126. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
  127. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +37 -0
  128. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
  129. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +61 -0
  130. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
  131. package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
  132. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
  133. package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
  134. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
  135. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +75 -0
  136. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
  137. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +25 -0
  138. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +92 -0
  139. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
  140. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
  141. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
  142. package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
  143. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
  144. package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
  145. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  146. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +123 -0
  147. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +211 -0
  148. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +86 -3
  149. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +457 -2
  150. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
  151. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +24 -2
  152. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +71 -1
  153. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
  154. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
  155. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +245 -0
  156. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
  157. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +146 -0
  158. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +54 -1
  159. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
  160. package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
  161. package/lib/view/financeStatement/financeStatementReducer.js +11 -8
  162. package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
  163. package/lib/view/financeStatement/financeStatementSelector.js +24 -9
  164. package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.d.ts +9 -0
  165. package/lib/view/profitAndLossClassesView/horizontalSectionEmptyBalancesSlice.js +20 -0
  166. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +15 -0
  167. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +335 -0
  168. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +111 -0
  169. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +13 -0
  170. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +4 -2
  171. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +7 -2
  172. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
  173. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +4 -0
  174. package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
  175. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +6 -0
  176. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +265 -0
  177. package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +8 -6
  178. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  179. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +1 -0
  180. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
  181. package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -0
  182. package/lib/view/taskManager/taskListView/taskListSelector.js +3 -1
  183. package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +23 -0
  184. package/lib/view/userGroupListView/userGroupListViewReducer.js +69 -0
  185. package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +7 -0
  186. package/lib/view/userGroupListView/userGroupListViewSelector.js +20 -0
  187. package/lib/view/userGroupListView/userGroupListViewState.d.ts +8 -0
  188. package/lib/view/userGroupListView/userGroupListViewState.js +2 -0
  189. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +3 -1
  190. package/lib/view/userListView/fetchUserListByTypeEpic.js +11 -0
  191. package/lib/view/userListView/userListViewPayload.d.ts +2 -0
  192. package/lib/zeniAPI.js +0 -2
  193. package/package.json +3 -3
@@ -13,6 +13,6 @@ export declare function getSummationBalance(summationType: 'year_to_date_total'
13
13
  allClosingMonthlyBalanceOrderedAsc: COABalance[];
14
14
  allOpeningMonthlyBalanceOrderedAsc: COABalance[];
15
15
  } | undefined): COABalance | undefined;
16
- export declare function getSummationFreeRangeTotalBalance(resultSlice: COABalance[]): COABalance | undefined;
16
+ export declare function getSummationFreeRangeTotalBalance(resultSlice: readonly COABalance[]): COABalance | undefined;
17
17
  export declare function getFreeRangeCashAndEquivalentsOpeningBalance(resultSlice: COABalance[], resultBalancesOrder: COABalancesOrder): COABalance | undefined;
18
18
  export declare function getFreeRangeCashAndEquivalentsClosingBalance(resultSlice: COABalance[], resultBalancesOrder: COABalancesOrder): COABalance | undefined;
@@ -5,3 +5,5 @@ export type COABalanceType = 'default' | 'default_with_percent' | 'default_with_
5
5
  export declare const toCOABalanceType: (v: string) => COABalanceType;
6
6
  export declare const toCOABalanceTypeStrict: (v: string) => COABalanceType | undefined;
7
7
  export declare const isCalculatedBalanceType: (id: string) => id is CalculatedBalance;
8
+ /** Removes compare-mode balance types (horizontal P&L-by-class does not use them). */
9
+ export declare function stripCompareAdditionalBalanceTypes(balances: readonly COABalanceType[]): COABalanceType[];
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isCalculatedBalanceType = exports.toCOABalanceTypeStrict = exports.toCOABalanceType = void 0;
4
+ exports.stripCompareAdditionalBalanceTypes = stripCompareAdditionalBalanceTypes;
4
5
  const stringToUnion_1 = require("../stringToUnion");
5
6
  const ALL_COA_BALANCE_FIELDS = [
6
7
  'default',
@@ -33,3 +34,8 @@ const toCOABalanceTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v
33
34
  exports.toCOABalanceTypeStrict = toCOABalanceTypeStrict;
34
35
  const isCalculatedBalanceType = (id) => ALL_CALCULATED_BALANCES.find((sectionId) => id === sectionId) != null;
35
36
  exports.isCalculatedBalanceType = isCalculatedBalanceType;
37
+ /** Removes compare-mode balance types (horizontal P&L-by-class does not use them). */
38
+ function stripCompareAdditionalBalanceTypes(balances) {
39
+ return balances.filter((balanceType) => balanceType !== 'this_period_vs_last_period' &&
40
+ balanceType !== 'this_period_vs_last_period_percent');
41
+ }
@@ -1 +1,4 @@
1
+ import { Currency } from './amount';
1
2
  export declare const isUsdCurrency: (currencyCode: string) => currencyCode is "USD";
3
+ /** Default home-currency fallback when tenant/report currency is unset. */
4
+ export declare const defaultCustomerCurrency: Currency;
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isUsdCurrency = void 0;
3
+ exports.defaultCustomerCurrency = exports.isUsdCurrency = void 0;
4
4
  const isUsdCurrency = (currencyCode) => {
5
5
  return currencyCode === 'USD';
6
6
  };
7
7
  exports.isUsdCurrency = isUsdCurrency;
8
+ /** Default home-currency fallback when tenant/report currency is unset. */
9
+ exports.defaultCustomerCurrency = {
10
+ currencyCode: 'USD',
11
+ currencySymbol: '$',
12
+ };
@@ -11,6 +11,15 @@ export declare const isAllFetchCompleted: (fetchStateList: FetchStateAndError[])
11
11
  * @return single fetchStateWithError
12
12
  */
13
13
  export declare function reduceFetchState(fetchStateList: FetchStateAndError[]): FetchStateAndError;
14
+ /**
15
+ * Combine multiple independent fetches (e.g. month / quarter / year for one report).
16
+ * In-Progress if any fetch is in progress; Completed only when all complete; Error if
17
+ * any failed once nothing is still in progress.
18
+ *
19
+ * Differs from {@link reduceFetchState} (requires all In-Progress for that state) and
20
+ * from {@link reduceAllFetchState} (Error only when every fetch failed).
21
+ */
22
+ export declare function reduceFetchStateParallelTimeframes(fetchStateList: FetchStateAndError[]): FetchStateAndError;
14
23
  /**
15
24
  * Reduces list of fetch state to boolean
16
25
  * @param fetchStateList list of fetch states
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.reduceAnyCompletedFetchState = exports.reduceAllFetchState = exports.reduceAnyFetchState = exports.isAnyFetchCompleted = exports.isAnyFetchInProgress = exports.isAllFetchCompleted = void 0;
4
4
  exports.reduceFetchState = reduceFetchState;
5
+ exports.reduceFetchStateParallelTimeframes = reduceFetchStateParallelTimeframes;
5
6
  /**
6
7
  * Reduces list of fetch state to boolean
7
8
  * @param fetchStateList list of fetch states
@@ -55,6 +56,31 @@ function reduceFetchState(fetchStateList) {
55
56
  error,
56
57
  };
57
58
  }
59
+ /**
60
+ * Combine multiple independent fetches (e.g. month / quarter / year for one report).
61
+ * In-Progress if any fetch is in progress; Completed only when all complete; Error if
62
+ * any failed once nothing is still in progress.
63
+ *
64
+ * Differs from {@link reduceFetchState} (requires all In-Progress for that state) and
65
+ * from {@link reduceAllFetchState} (Error only when every fetch failed).
66
+ */
67
+ function reduceFetchStateParallelTimeframes(fetchStateList) {
68
+ const isAnyProgress = fetchStateList.some((s) => s.fetchState === 'In-Progress');
69
+ const isAllCompleted = fetchStateList.every((s) => s.fetchState === 'Completed');
70
+ const isAnyError = fetchStateList.some((s) => s.fetchState === 'Error');
71
+ const error = reduceError(fetchStateList);
72
+ let fetchState = 'Not-Started';
73
+ if (isAnyProgress) {
74
+ fetchState = 'In-Progress';
75
+ }
76
+ else if (isAllCompleted) {
77
+ fetchState = 'Completed';
78
+ }
79
+ else if (isAnyError) {
80
+ fetchState = 'Error';
81
+ }
82
+ return { fetchState, error };
83
+ }
58
84
  /**
59
85
  * Reduces list of fetch state to boolean
60
86
  * @param fetchStateList list of fetch states
package/lib/coreEpics.js CHANGED
@@ -24,6 +24,7 @@ const resendVerifyDeviceOTPEpic_1 = require("./entity/tenant/epic/resendVerifyDe
24
24
  const saveExternalConnectionEpic_1 = require("./entity/tenant/epic/saveExternalConnectionEpic");
25
25
  const sendEmailMagicLinkToUserEpic_1 = require("./entity/tenant/epic/sendEmailMagicLinkToUserEpic");
26
26
  const signInUserEpic_1 = require("./entity/tenant/epic/signInUserEpic");
27
+ const sessionHeartbeatEpic_1 = require("./entity/tenant/epic/sessionHeartbeatEpic");
27
28
  const signOutUserEpic_1 = require("./entity/tenant/epic/signOutUserEpic");
28
29
  const verifyDeviceWithTwoFAEpic_1 = require("./entity/tenant/epic/verifyDeviceWithTwoFAEpic");
29
30
  // ── Toast Notification Epic ──────────────────────────────────────────
@@ -48,7 +49,7 @@ const verifyOtpEpic_1 = require("./view/twoFactorAuthentication/verifyOtpEpic");
48
49
  // RootActionType is only available in the dynamically imported epic.ts.
49
50
  const coreRootEpic = (0, redux_observable_1.combineEpics)(
50
51
  // Auth & tenant
51
- clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic, fetchActiveTenantEpic_1.fetchActiveTenantEpic, fetchAllTenantsEpic_1.fetchAllTenantsEpic, fetchExcludedResourcesEpic_1.fetchExcludedResourcesEpic, fetchExternalConnectionsEpic_1.fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic_1.fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic_1.resendVerifyDeviceOTPEpic, saveExternalConnectionEpic_1.saveExternalConnectionEpic, sendEmailMagicLinkToUserEpic_1.sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic_1.verifyDeviceWithTwoFAEpic,
52
+ clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic, sessionHeartbeatEpic_1.sessionHeartbeatEpic, fetchActiveTenantEpic_1.fetchActiveTenantEpic, fetchAllTenantsEpic_1.fetchAllTenantsEpic, fetchExcludedResourcesEpic_1.fetchExcludedResourcesEpic, fetchExternalConnectionsEpic_1.fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic_1.fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic_1.resendVerifyDeviceOTPEpic, saveExternalConnectionEpic_1.saveExternalConnectionEpic, sendEmailMagicLinkToUserEpic_1.sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic_1.verifyDeviceWithTwoFAEpic,
52
53
  // Toast
53
54
  pushToastNotificationEpic_1.pushToastNotificationEpic,
54
55
  // Collaboration
@@ -16,6 +16,8 @@ export interface AccountBasePayload {
16
16
  is_deleted?: boolean | null;
17
17
  last_4_digits?: string | null;
18
18
  logo?: URLPayload;
19
+ payment_type?: string | null;
20
+ payment_type_name?: string | null;
19
21
  qbo_id?: string;
20
22
  reconciliation_source?: string | null;
21
23
  tax_1099_config?: Tax1099ConfigPayload | null;
@@ -13,6 +13,8 @@ const mapAccountBasePayloadToAccountBase = (payload) => ({
13
13
  accountDescription: payload.account_description ?? '',
14
14
  last4Digits: payload.last_4_digits ?? undefined,
15
15
  logo: payload.logo == null ? undefined : (0, urlPayload_1.toURL)(payload.logo),
16
+ paymentType: payload.payment_type ?? undefined,
17
+ paymentTypeName: payload.payment_type_name ?? undefined,
16
18
  qboId: payload.qbo_id ?? undefined,
17
19
  coaId: payload.coa_id ?? undefined,
18
20
  labels: toAccountLabelArray(payload.labels ?? []),
@@ -43,6 +43,8 @@ export interface AccountBase {
43
43
  isPreFilled?: boolean;
44
44
  last4Digits?: string;
45
45
  logo?: ZeniUrl;
46
+ paymentType?: string;
47
+ paymentTypeName?: string;
46
48
  qboId?: ID;
47
49
  reconciliationSource?: ReconciliationAccountSourceType;
48
50
  tax1099Config?: Tax1099Config;
@@ -1,4 +1,3 @@
1
- import { Currency } from '../../commonStateTypes/amount';
2
1
  import { ID } from '../../commonStateTypes/common';
3
2
  import { ZeniDate } from '../../zeniDayJS';
4
3
  import { ZeniUrl as Url } from '../../zeniUrl';
@@ -47,4 +46,3 @@ export interface Customer extends CustomerBase {
47
46
  export interface CustomerState {
48
47
  byCustomerId: Record<ID, Customer>;
49
48
  }
50
- export declare const defaultCustomerCurrency: Currency;
@@ -1,7 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultCustomerCurrency = void 0;
4
- exports.defaultCustomerCurrency = {
5
- currencyCode: 'USD',
6
- currencySymbol: '$',
7
- };
@@ -40,7 +40,7 @@ export interface DepositSubAccountType {
40
40
  code: DepositSubAccountTypeCodeType;
41
41
  name: string;
42
42
  }
43
- export declare const toDepositSubAccounTypeCodeType: (v: string) => "checking" | "savings";
43
+ export declare const toDepositSubAccounTypeCodeType: (v: string) => "Zinc" | "Bronze" | "Gold" | "Silver" | "Platinum" | "Checking";
44
44
  type DepositSubAccountTypeCodeType = ReturnType<typeof toDepositSubAccounTypeCodeType>;
45
45
  export declare const toDepositAccountStatusType: (v: string) => "Open" | "Frozen" | "Closed";
46
46
  export type DepositAccountStatus = ReturnType<typeof toDepositAccountStatusType>;
@@ -2,7 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toDepositAccountStatusType = exports.toDepositSubAccounTypeCodeType = void 0;
4
4
  const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
5
- const ALL_DEPOSIT_SUB_ACCOUNT_TYPE_CODE = ['checking', 'savings'];
5
+ const ALL_DEPOSIT_SUB_ACCOUNT_TYPE_CODE = [
6
+ 'Zinc',
7
+ 'Bronze',
8
+ 'Gold',
9
+ 'Silver',
10
+ 'Platinum',
11
+ 'Checking',
12
+ ];
6
13
  const toDepositSubAccounTypeCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_DEPOSIT_SUB_ACCOUNT_TYPE_CODE);
7
14
  exports.toDepositSubAccounTypeCodeType = toDepositSubAccounTypeCodeType;
8
15
  const ALL_DEPOSIT_ACCOUNT_STATUS_TYPE = ['Closed', 'Open', 'Frozen'];
@@ -3,6 +3,7 @@ import { SegregatedReimbursementLineWithRecommendation } from '../../view/spendM
3
3
  import { AccountBasePayload } from '../account/accountPayload';
4
4
  import { BillAccountPayload, BillPaymentMethodPayload, BillPaymentStatusPayload, BillStagePayload, BillStatusPayload, BulkOperationDetailPayload, DeletionInfoPayload } from '../billPay/billTransaction/billTransactionPayload';
5
5
  import { ClassBasePayload } from '../class/classPayload';
6
+ import { CustomerBasePayload } from '../customer/customerPayload';
6
7
  import { MerchantBasePayload } from '../merchant/merchantPayload';
7
8
  import { AttachmentPayload } from '../transaction/payloadTypes/attachmentPayload';
8
9
  import { LineDetail, Reimbursement, ReimbursementTypeCode } from './reimbursementState';
@@ -68,6 +69,7 @@ interface ReimbursementTypePayload {
68
69
  export interface LineDetailPayload {
69
70
  class: ClassBasePayload;
70
71
  account?: AccountBasePayload;
72
+ customer?: CustomerBasePayload;
71
73
  }
72
74
  interface ReimbursementInfoPayload {
73
75
  actual_deposit_date: string | null;
@@ -8,6 +8,7 @@ const zeniDayJS_1 = require("../../zeniDayJS");
8
8
  const accountPayload_1 = require("../account/accountPayload");
9
9
  const billTransactionPayload_1 = require("../billPay/billTransaction/billTransactionPayload");
10
10
  const classPayload_1 = require("../class/classPayload");
11
+ const customerPayload_1 = require("../customer/customerPayload");
11
12
  const merchantPayload_1 = require("../merchant/merchantPayload");
12
13
  const attachmentPayload_1 = require("../transaction/payloadTypes/attachmentPayload");
13
14
  const ALL_REIMBURSEMENT_TRANSACTION_TYPE = ['reimbursement'];
@@ -171,6 +172,9 @@ const toLineDetailPayload = (lineDetail) => ({
171
172
  account: lineDetail.account != null
172
173
  ? (0, accountPayload_1.toAccountPayload)(lineDetail.account)
173
174
  : undefined,
175
+ customer: lineDetail.customer != null
176
+ ? (0, customerPayload_1.toCustomerBasePayload)(undefined, lineDetail.customer)
177
+ : undefined,
174
178
  });
175
179
  exports.toLineDetailPayload = toLineDetailPayload;
176
180
  const toLineDetail = (payload) => ({
@@ -180,6 +184,9 @@ const toLineDetail = (payload) => ({
180
184
  account: payload.account?.account_id != null
181
185
  ? (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(payload.account)
182
186
  : undefined,
187
+ customer: payload.customer?.customer_id != null
188
+ ? (0, customerPayload_1.toCustomerBase)(payload.customer, false)
189
+ : undefined,
183
190
  });
184
191
  const toDistanceMilage = (payload) => ({
185
192
  unit: payload.unit,
@@ -6,6 +6,7 @@ import { ZeniUrl as Url } from '../../zeniUrl';
6
6
  import { AccountBase } from '../account/accountState';
7
7
  import { BillPaymentStatus, BillStage, BillStatus, BulkProcessingDetail, DeletionInfo } from '../billPay/billTransaction/billTransactionState';
8
8
  import { ClassBase } from '../class/classState';
9
+ import { CustomerBase } from '../customer/customerState';
9
10
  import { MerchantBase } from '../merchant/merchant';
10
11
  import { Attachment } from '../transaction/stateTypes/attachment';
11
12
  import { ReimbursementTransactionType } from './reimbursementPayload';
@@ -58,6 +59,7 @@ export interface DistanceMilage {
58
59
  export interface LineDetail {
59
60
  account?: AccountBase;
60
61
  class?: ClassBase;
62
+ customer?: CustomerBase;
61
63
  }
62
64
  export interface ReimbursementInfo {
63
65
  billPaymentMethodType: RemiPaymentMethod;
@@ -1,4 +1,4 @@
1
- export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed";
1
+ export declare const toSnackbarMessageSection: (v: string) => "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed";
2
2
  export type SnackbarMessageSections = ReturnType<typeof toSnackbarMessageSection>;
3
3
  export declare const toSnackbarMessageSectionTexts: (v: string) => "notification" | "success" | "failed";
4
4
  export type SnackbarMessageSectionTexts = ReturnType<typeof toSnackbarMessageSectionTexts>;
@@ -152,7 +152,9 @@ const ALL_SNACKBAR_MESSAGE_SECTIONS = [
152
152
  'missing_receipts_attachment',
153
153
  'flux_analysis_unreviewed',
154
154
  'flux_analysis_reviewed',
155
+ 'receipt_match',
155
156
  'receipts_upload',
157
+ 'receipts_bulk_match',
156
158
  'billing_address_view',
157
159
  'express_pay_submit',
158
160
  'exclude_transaction',
@@ -21,6 +21,7 @@ export interface TaskPayload {
21
21
  type: AllowedValueWithCodePayload;
22
22
  update_time: string | null;
23
23
  company_id?: string;
24
+ group_assignees?: string[];
24
25
  sync_token?: string | null;
25
26
  task_group_ids?: string[] | null;
26
27
  }
@@ -42,5 +42,6 @@ const mapTaskPayloadToTask = (payload) => ({
42
42
  timeSpent: payload.time_spent != null
43
43
  ? (0, formatMinutesToFromHHMM_1.convertMinutesToHHMM)(payload.time_spent)
44
44
  : (0, formatMinutesToFromHHMM_1.convertMinutesToHHMM)(0),
45
+ groupAssignees: payload.group_assignees ?? [],
45
46
  });
46
47
  exports.mapTaskPayloadToTask = mapTaskPayloadToTask;
@@ -7,6 +7,7 @@ export interface Task {
7
7
  createTime: ZeniDate;
8
8
  description: string;
9
9
  fileIds: string[];
10
+ groupAssignees: ID[];
10
11
  id: ID;
11
12
  isArchived: boolean;
12
13
  isDeleted: boolean;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * SessionManager — Central session lifecycle manager.
3
+ *
4
+ * Responsibilities:
5
+ * 1. Track user activity (mousemove, keydown, click, scroll, touch)
6
+ * 2. Send heartbeat at configurable intervals while user is active
7
+ * 3. Show warning popup after idle timeout
8
+ * 4. Auto-logout after warning countdown expires
9
+ */
10
+ import { SessionCallbacks, SessionConfig } from './sessionTypes';
11
+ export declare class SessionManager {
12
+ private config;
13
+ private callbacks;
14
+ /** Timestamps and timers */
15
+ private lastActivityTime;
16
+ private idleCheckInterval;
17
+ private heartbeatInterval;
18
+ private countdownInterval;
19
+ private activityDebounceTimer;
20
+ /** State */
21
+ private running;
22
+ private warningActive;
23
+ private secondsRemaining;
24
+ /** Bound handler for event listener cleanup. */
25
+ private boundOnActivity;
26
+ private boundOnVisibilityChange;
27
+ start(config: Partial<SessionConfig> | undefined, callbacks: SessionCallbacks): void;
28
+ stop(): void;
29
+ continueSession(): void;
30
+ isWarningActive(): boolean;
31
+ getSecondsRemaining(): number;
32
+ private onActivity;
33
+ private onVisibilityChange;
34
+ private checkIdle;
35
+ private startWarning;
36
+ private startHeartbeat;
37
+ private clearTimer;
38
+ }
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ /**
3
+ * SessionManager — Central session lifecycle manager.
4
+ *
5
+ * Responsibilities:
6
+ * 1. Track user activity (mousemove, keydown, click, scroll, touch)
7
+ * 2. Send heartbeat at configurable intervals while user is active
8
+ * 3. Show warning popup after idle timeout
9
+ * 4. Auto-logout after warning countdown expires
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SessionManager = void 0;
13
+ const sessionTypes_1 = require("./sessionTypes");
14
+ /** Events that indicate user activity. */
15
+ const ACTIVITY_EVENTS = [
16
+ 'mousemove',
17
+ 'mousedown',
18
+ 'keydown',
19
+ 'scroll',
20
+ 'touchstart',
21
+ 'click',
22
+ ];
23
+ /** Debounce interval for activity events (ms). */
24
+ const ACTIVITY_DEBOUNCE_MS = 1000;
25
+ class SessionManager {
26
+ constructor() {
27
+ this.config = sessionTypes_1.DEFAULT_SESSION_CONFIG;
28
+ this.callbacks = null;
29
+ /** Timestamps and timers */
30
+ this.lastActivityTime = 0;
31
+ this.idleCheckInterval = null;
32
+ this.heartbeatInterval = null;
33
+ this.countdownInterval = null;
34
+ this.activityDebounceTimer = null;
35
+ /** State */
36
+ this.running = false;
37
+ this.warningActive = false;
38
+ this.secondsRemaining = 0;
39
+ /** Bound handler for event listener cleanup. */
40
+ this.boundOnActivity = this.onActivity.bind(this);
41
+ this.boundOnVisibilityChange = this.onVisibilityChange.bind(this);
42
+ }
43
+ // ─── Public API ────────────────────────────────────────────
44
+ start(config = {}, callbacks) {
45
+ if (this.running) {
46
+ this.stop();
47
+ }
48
+ this.config = { ...sessionTypes_1.DEFAULT_SESSION_CONFIG, ...config };
49
+ this.callbacks = callbacks;
50
+ this.running = true;
51
+ this.warningActive = false;
52
+ this.lastActivityTime = Date.now();
53
+ if (!this.config.isAutoLogoutEnabled) {
54
+ return;
55
+ }
56
+ ACTIVITY_EVENTS.forEach((event) => {
57
+ document.addEventListener(event, this.boundOnActivity, {
58
+ capture: true,
59
+ passive: true,
60
+ });
61
+ });
62
+ document.addEventListener('visibilitychange', this.boundOnVisibilityChange);
63
+ this.startHeartbeat();
64
+ this.callbacks?.onHeartbeat();
65
+ this.idleCheckInterval = setInterval(() => this.checkIdle(), 1000);
66
+ }
67
+ stop() {
68
+ this.running = false;
69
+ this.warningActive = false;
70
+ ACTIVITY_EVENTS.forEach((event) => {
71
+ document.removeEventListener(event, this.boundOnActivity, {
72
+ capture: true,
73
+ });
74
+ });
75
+ document.removeEventListener('visibilitychange', this.boundOnVisibilityChange);
76
+ this.clearTimer('idleCheckInterval');
77
+ this.clearTimer('heartbeatInterval');
78
+ this.clearTimer('countdownInterval');
79
+ this.clearTimer('activityDebounceTimer');
80
+ }
81
+ continueSession() {
82
+ if (!this.running) {
83
+ return;
84
+ }
85
+ this.warningActive = false;
86
+ this.secondsRemaining = 0;
87
+ this.lastActivityTime = Date.now();
88
+ this.clearTimer('countdownInterval');
89
+ this.callbacks?.onHeartbeat();
90
+ this.callbacks?.onSessionExtended();
91
+ this.startHeartbeat();
92
+ }
93
+ isWarningActive() {
94
+ return this.warningActive;
95
+ }
96
+ getSecondsRemaining() {
97
+ return this.secondsRemaining;
98
+ }
99
+ // ─── Private ───────────────────────────────────────────────
100
+ onActivity() {
101
+ if (!this.running || this.warningActive) {
102
+ return;
103
+ }
104
+ if (this.activityDebounceTimer != null) {
105
+ return;
106
+ }
107
+ this.lastActivityTime = Date.now();
108
+ this.activityDebounceTimer = setTimeout(() => {
109
+ this.activityDebounceTimer = null;
110
+ }, ACTIVITY_DEBOUNCE_MS);
111
+ }
112
+ onVisibilityChange() {
113
+ if (!this.running) {
114
+ return;
115
+ }
116
+ if (document.visibilityState === 'visible') {
117
+ this.lastActivityTime = Date.now();
118
+ this.checkIdle();
119
+ }
120
+ }
121
+ checkIdle() {
122
+ if (!this.running || this.warningActive) {
123
+ return;
124
+ }
125
+ const idleMs = Date.now() - this.lastActivityTime;
126
+ const idleTimeoutMs = this.config.idleTimeoutMinutes * 60 * 1000;
127
+ if (idleMs >= idleTimeoutMs) {
128
+ this.startWarning();
129
+ }
130
+ }
131
+ startWarning() {
132
+ this.warningActive = true;
133
+ this.secondsRemaining = this.config.warningDurationSeconds;
134
+ this.clearTimer('heartbeatInterval');
135
+ this.callbacks?.onWarningStart(this.secondsRemaining);
136
+ this.countdownInterval = setInterval(() => {
137
+ this.secondsRemaining -= 1;
138
+ if (this.secondsRemaining <= 0) {
139
+ this.clearTimer('countdownInterval');
140
+ this.warningActive = false;
141
+ this.callbacks?.onAutoLogout();
142
+ }
143
+ else {
144
+ this.callbacks?.onWarningTick(this.secondsRemaining);
145
+ }
146
+ }, 1000);
147
+ }
148
+ startHeartbeat() {
149
+ this.clearTimer('heartbeatInterval');
150
+ const intervalMs = this.config.heartbeatIntervalMinutes * 60 * 1000;
151
+ this.heartbeatInterval = setInterval(() => {
152
+ if (!this.running || this.warningActive) {
153
+ return;
154
+ }
155
+ this.callbacks?.onHeartbeat();
156
+ }, intervalMs);
157
+ }
158
+ clearTimer(name) {
159
+ const timer = this[name];
160
+ if (timer != null) {
161
+ if (name === 'activityDebounceTimer') {
162
+ clearTimeout(timer);
163
+ }
164
+ else {
165
+ clearInterval(timer);
166
+ }
167
+ this[name] = null;
168
+ }
169
+ }
170
+ }
171
+ exports.SessionManager = SessionManager;
@@ -0,0 +1,16 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { RootState } from '../../../reducer';
3
+ import { ZeniAPI } from '../../../zeniAPI';
4
+ import { sendSessionHeartbeat, sessionHeartbeatFailure, sessionHeartbeatSuccess } from '../tenantReducer';
5
+ export type ActionType = ReturnType<typeof sendSessionHeartbeat> | ReturnType<typeof sessionHeartbeatSuccess> | ReturnType<typeof sessionHeartbeatFailure>;
6
+ export declare const sessionHeartbeatEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
+ payload: {
8
+ expiresAt: string;
9
+ };
10
+ type: "tenant/sessionHeartbeatSuccess";
11
+ } | {
12
+ payload: {
13
+ error: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
14
+ };
15
+ type: "tenant/sessionHeartbeatFailure";
16
+ }>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sessionHeartbeatEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../responsePayload");
7
+ const tenantReducer_1 = require("../tenantReducer");
8
+ const sessionHeartbeatEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.sendSessionHeartbeat.match), (0, operators_1.switchMap)(() => zeniAPI
9
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/sessions/heartbeat`)
10
+ .pipe((0, operators_1.mergeMap)((response) => {
11
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
12
+ return (0, rxjs_1.of)((0, tenantReducer_1.sessionHeartbeatSuccess)(response.data?.expiry ?? ''));
13
+ }
14
+ return (0, rxjs_1.of)((0, tenantReducer_1.sessionHeartbeatFailure)(response.status));
15
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, tenantReducer_1.sessionHeartbeatFailure)((0, responsePayload_1.createZeniAPIStatus)('Heartbeat failed', 'Session heartbeat API call errored: ' + JSON.stringify(error))))))));
16
+ exports.sessionHeartbeatEpic = sessionHeartbeatEpic;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Session management types for idle timeout and heartbeat.
3
+ */
4
+ export interface SessionConfig {
5
+ /** Minutes between heartbeat API calls while user is active. Default: 10 */
6
+ heartbeatIntervalMinutes: number;
7
+ /** Minutes of inactivity before the warning popup appears. Default: 30 */
8
+ idleTimeoutMinutes: number;
9
+ /** Whether auto-logout is enabled. Default: true */
10
+ isAutoLogoutEnabled: boolean;
11
+ /** Seconds to count down in the warning popup before auto-logout. Default: 60 */
12
+ warningDurationSeconds: number;
13
+ }
14
+ export declare const DEFAULT_SESSION_CONFIG: SessionConfig;
15
+ export interface SessionCallbacks {
16
+ /** Called when the countdown reaches zero — app should sign out. */
17
+ onAutoLogout: () => void;
18
+ /** Called to send a heartbeat API request. */
19
+ onHeartbeat: () => void;
20
+ /** Called when the session is extended (heartbeat success or "Continue Session"). */
21
+ onSessionExtended: () => void;
22
+ /** Called when the warning countdown starts. */
23
+ onWarningStart: (secondsRemaining: number) => void;
24
+ /** Called every second during the countdown. */
25
+ onWarningTick: (secondsRemaining: number) => void;
26
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * Session management types for idle timeout and heartbeat.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DEFAULT_SESSION_CONFIG = void 0;
7
+ exports.DEFAULT_SESSION_CONFIG = {
8
+ heartbeatIntervalMinutes: 10,
9
+ idleTimeoutMinutes: 30,
10
+ isAutoLogoutEnabled: true,
11
+ warningDurationSeconds: 60,
12
+ };