@zeniai/client-epic-state 5.1.21 → 5.1.23-betaNB1

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 (80) hide show
  1. package/README.md +2 -1
  2. package/lib/commonStateTypes/viewAndReport/agingReportStateTypes.d.ts +1 -1
  3. package/lib/entity/accountRecon/accountReconPayload.d.ts +23 -1
  4. package/lib/entity/accountRecon/accountReconPayload.js +26 -1
  5. package/lib/entity/accountRecon/accountReconReducer.d.ts +5 -2
  6. package/lib/entity/accountRecon/accountReconReducer.js +33 -2
  7. package/lib/entity/accountRecon/accountReconSelector.d.ts +6 -1
  8. package/lib/entity/accountRecon/accountReconSelector.js +5 -0
  9. package/lib/entity/accountRecon/accountReconState.d.ts +22 -0
  10. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.d.ts +8 -0
  11. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +10 -0
  12. package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +8 -0
  13. package/lib/epic.d.ts +6 -1
  14. package/lib/epic.js +6 -1
  15. package/lib/esm/entity/accountRecon/accountReconPayload.js +26 -1
  16. package/lib/esm/entity/accountRecon/accountReconReducer.js +32 -1
  17. package/lib/esm/entity/accountRecon/accountReconSelector.js +5 -0
  18. package/lib/esm/entity/monthEndCloseChecks/monthEndCloseChecksPayload.js +10 -0
  19. package/lib/esm/epic.js +6 -1
  20. package/lib/esm/index.js +7 -7
  21. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +29 -3
  22. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +11 -0
  23. package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -2
  24. package/lib/esm/view/aiCfoView/epics/fetchSkillsEpic.js +34 -0
  25. package/lib/esm/view/aiCfoView/epics/submitQuestionEpic.js +7 -1
  26. package/lib/esm/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +34 -0
  27. package/lib/esm/view/expenseAutomationView/epics/accountRecon/reparseStatementEpic.js +31 -0
  28. package/lib/esm/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +57 -0
  29. package/lib/esm/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +1 -0
  30. package/lib/esm/view/expenseAutomationView/payload/reconciliationPayload.js +142 -0
  31. package/lib/esm/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +6 -1
  32. package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +178 -8
  33. package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -1
  34. package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +27 -0
  35. package/lib/esm/view/expenseAutomationView/types/reconciliationViewState.js +29 -0
  36. package/lib/esm/view/opExByVendor/opExByVendorReducer.js +28 -5
  37. package/lib/esm/view/opExByVendor/opExByVendorSelector.js +1 -0
  38. package/lib/esm/view/opExByVendor/refreshOpExByVendorReportEpic.js +21 -0
  39. package/lib/index.d.ts +12 -12
  40. package/lib/index.js +56 -37
  41. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +14 -0
  42. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +8 -4
  43. package/lib/view/aiCfoView/aiCfoViewReducer.js +30 -4
  44. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +2 -1
  45. package/lib/view/aiCfoView/aiCfoViewSelector.js +12 -0
  46. package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -0
  47. package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -2
  48. package/lib/view/aiCfoView/epics/fetchSkillsEpic.d.ts +8 -0
  49. package/lib/view/aiCfoView/epics/fetchSkillsEpic.js +38 -0
  50. package/lib/view/aiCfoView/epics/submitQuestionEpic.js +7 -1
  51. package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.d.ts +6 -0
  52. package/lib/view/expenseAutomationView/epics/accountRecon/parseStatementEpic.js +38 -0
  53. package/lib/view/expenseAutomationView/epics/accountRecon/reparseStatementEpic.d.ts +26 -0
  54. package/lib/view/expenseAutomationView/epics/accountRecon/reparseStatementEpic.js +35 -0
  55. package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.d.ts +27 -0
  56. package/lib/view/expenseAutomationView/epics/accountRecon/updateStatementInfoEpic.js +61 -0
  57. package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +1 -0
  58. package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +8 -0
  59. package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +163 -9
  60. package/lib/view/expenseAutomationView/payload/reconciliationPayload.js +146 -0
  61. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +2 -1
  62. package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +6 -1
  63. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +53 -3
  64. package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +180 -9
  65. package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -1
  66. package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +2 -1
  67. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.d.ts +2 -0
  68. package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +29 -1
  69. package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +2 -0
  70. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +172 -0
  71. package/lib/view/expenseAutomationView/types/reconciliationViewState.js +30 -0
  72. package/lib/view/opExByVendor/opExByVendorReducer.d.ts +6 -1
  73. package/lib/view/opExByVendor/opExByVendorReducer.js +29 -6
  74. package/lib/view/opExByVendor/opExByVendorSelector.d.ts +1 -0
  75. package/lib/view/opExByVendor/opExByVendorSelector.js +1 -0
  76. package/lib/view/opExByVendor/opExByVendorState.d.ts +1 -0
  77. package/lib/view/opExByVendor/refreshOpExByVendorReportEpic.d.ts +17 -0
  78. package/lib/view/opExByVendor/refreshOpExByVendorReportEpic.js +25 -0
  79. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +1 -1
  80. package/package.json +4 -2
@@ -7,6 +7,130 @@ import { BankStatusCodeType } from '../../../entity/accountRecon/accountReconSta
7
7
  import { CustomerBase } from '../../../entity/customer/customerState';
8
8
  import { VendorBase } from '../../../entity/vendor/vendorState';
9
9
  import { ZeniAPIStatus } from '../../../responsePayload';
10
+ import { ReconciliationSummaryPayload } from '../payload/reconciliationPayload';
11
+ export interface PolygonPoint {
12
+ x: number;
13
+ y: number;
14
+ }
15
+ export interface Citation {
16
+ page: number;
17
+ pageHeight: number;
18
+ pageWidth: number;
19
+ polygon: PolygonPoint[];
20
+ referenceText: string;
21
+ }
22
+ export interface StatementTransaction {
23
+ amount: number;
24
+ citations: Citation[];
25
+ isUserAdded: boolean;
26
+ isUserEdited: boolean;
27
+ statementTransactionId: string;
28
+ transactionDate: string;
29
+ transactionDirection: 'debit' | 'credit';
30
+ transactionMemo: string;
31
+ }
32
+ export interface StatementMeta {
33
+ closingBalance: number;
34
+ openingBalance: number;
35
+ statementDataStatus: {
36
+ code: string;
37
+ label: string;
38
+ };
39
+ statementEndDate: string;
40
+ statementStartDate: string;
41
+ statementStatus: {
42
+ code: string;
43
+ label: string;
44
+ };
45
+ statementUploadId: string;
46
+ totalDeposits: number;
47
+ totalPayments: number;
48
+ }
49
+ export interface AccountInfo {
50
+ accountId: string;
51
+ accountName: string;
52
+ accountType: string;
53
+ currencyCode: string;
54
+ last4Digits: string | null;
55
+ }
56
+ export interface FileInfo {
57
+ fileId: string;
58
+ fileName: string;
59
+ signedUrl: string;
60
+ }
61
+ export interface AiSummaryField {
62
+ code: string;
63
+ label: string;
64
+ }
65
+ export interface PreviousReconciliationInfo {
66
+ endDate: string;
67
+ reconciledAt: string;
68
+ reconciledByUserId: string;
69
+ reconciliationId: string;
70
+ startDate: string;
71
+ }
72
+ export interface AiSummaryChainStatus {
73
+ code: string;
74
+ expectedStartDate: string | null;
75
+ label: string;
76
+ previousReconciliationInfo: PreviousReconciliationInfo | null;
77
+ }
78
+ /**
79
+ * Surfaced when Confirm & Save is rejected with a 409 because the statement
80
+ * period overlaps with / leaves a gap after an already-reconciled period.
81
+ */
82
+ export interface StatementDateConflict {
83
+ errorCode: string;
84
+ expectedStartDate: string | null;
85
+ previousReconciliationInfo: PreviousReconciliationInfo;
86
+ }
87
+ export interface AiSummary {
88
+ accountIdentified: string | null;
89
+ chainStatus: AiSummaryChainStatus;
90
+ exceptionsDetected: number;
91
+ fieldsCaptured: AiSummaryField[];
92
+ transactionsExtracted: number;
93
+ }
94
+ export interface StatementUpload {
95
+ account: AccountInfo;
96
+ file: FileInfo | null;
97
+ statementMeta: StatementMeta;
98
+ statementTransactions: StatementTransaction[];
99
+ aiSummary?: AiSummary | null;
100
+ }
101
+ export interface ParsedStatementData {
102
+ statementUpload: StatementUpload;
103
+ }
104
+ export interface ReconciliationSummaryAccounts {
105
+ done: number;
106
+ failed: number;
107
+ inProgress: number;
108
+ total: number;
109
+ }
110
+ export interface ReconciliationSummaryAutoMatched {
111
+ matchedTxns: number;
112
+ totalTxns: number;
113
+ }
114
+ export interface ReconciliationSummaryNeedsReview {
115
+ accountCount: number;
116
+ txnCount: number;
117
+ }
118
+ export interface ReconciliationSummaryProgressBar {
119
+ aiPercentageShare: number;
120
+ completePercentage: number;
121
+ humanPercentageShare: number;
122
+ remainingPercentage: number;
123
+ }
124
+ export interface ReconciliationViewSummary {
125
+ accounts: ReconciliationSummaryAccounts;
126
+ accountsToConnectCount: number;
127
+ autoMatched: ReconciliationSummaryAutoMatched;
128
+ needsReview: ReconciliationSummaryNeedsReview;
129
+ timeSavedHours: number;
130
+ timeSavedPercentage: number;
131
+ progressBar?: ReconciliationSummaryProgressBar;
132
+ }
133
+ export declare function toReconciliationViewSummary(payload: ReconciliationSummaryPayload): ReconciliationViewSummary;
10
134
  export declare const RECONCILE_ACTIONS: readonly ["reconcile", "save_reconcile_for_later", "exclude"];
11
135
  export declare const toReconcileActions: (v: string) => "reconcile" | "save_reconcile_for_later" | "exclude";
12
136
  export type ReconcileActionType = ReturnType<typeof toReconcileActions>;
@@ -107,9 +231,11 @@ export interface ReconciliationViewState extends FetchStateAndError {
107
231
  reconTabsState: ReconciliationTabsState;
108
232
  refreshStatus: FetchStateAndError;
109
233
  selectedTab: ReconciliationViewTabType;
234
+ statementProcessingFailed: boolean;
110
235
  statementUploadChosen: boolean;
111
236
  selectedAccountId?: ID;
112
237
  selectedDrawerAccountId?: ID;
238
+ summary?: ReconciliationViewSummary;
113
239
  }
114
240
  export interface BankConnectionStatus {
115
241
  connectionInProgress: boolean;
@@ -120,19 +246,65 @@ export interface AccountReconciliationRecords {
120
246
  accountIDs: ID[];
121
247
  reconciliationByAccountID: Record<ID, AccountReconciliationDataWithTransactionFetchState>;
122
248
  }
249
+ export interface StatementTransactionForUpdate {
250
+ amount: number;
251
+ transactionDate: string;
252
+ transactionDirection: 'debit' | 'credit';
253
+ transactionMemo: string;
254
+ statementTransactionId?: string;
255
+ }
256
+ export interface StatementTransactionsUpdate {
257
+ added: StatementTransactionForUpdate[];
258
+ deletedIds: string[];
259
+ updated: StatementTransactionForUpdate[];
260
+ }
261
+ export interface StatementUpdateLocalData {
262
+ statementMeta: StatementMeta;
263
+ statementTransactions: StatementTransactionsUpdate;
264
+ }
265
+ export interface StatementUpdateLocalDataPayload {
266
+ statement_meta: {
267
+ opening_balance: number;
268
+ statement_end_date: string;
269
+ statement_start_date: string;
270
+ total_deposits: number;
271
+ total_payments: number;
272
+ };
273
+ statement_transactions: {
274
+ added: Array<{
275
+ amount: number;
276
+ transaction_date: string;
277
+ transaction_direction: 'debit' | 'credit';
278
+ transaction_memo: string;
279
+ }>;
280
+ deleted_ids: string[];
281
+ updated: Array<{
282
+ amount: number;
283
+ statement_transaction_id: string;
284
+ transaction_date: string;
285
+ transaction_direction: 'debit' | 'credit';
286
+ transaction_memo: string;
287
+ }>;
288
+ };
289
+ }
123
290
  export interface AccountReconciliationLocalData {
124
291
  accountSource?: ReconciliationAccountSourceType;
292
+ statementUpdateLocalData?: StatementUpdateLocalData;
125
293
  }
126
294
  export interface AccountReconciliationDataWithTransactionFetchState {
127
295
  accountId: ID;
128
296
  localData: AccountReconciliationLocalData;
129
297
  refreshStatus: FetchStateAndError;
298
+ reparseStatementStatus: FetchStateAndError;
299
+ statementDateConflict: StatementDateConflict | null;
130
300
  statementDeleteStatus: FetchStateAndError;
131
301
  statementParseInProgress: boolean;
302
+ statementParseStatus: FetchStateAndError;
132
303
  statementUpdateStatus: FetchStateAndError;
133
304
  statementUploadStatus: FetchStateAndError;
134
305
  transactionFetchState: FetchStateAndError;
135
306
  accountDetectionReason?: string;
307
+ parsedStatementData?: ParsedStatementData;
136
308
  reconciliationId?: ID;
137
309
  }
138
310
  export {};
@@ -1,7 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toReconciliationTabsType = exports.toReconcileActions = exports.RECONCILE_ACTIONS = void 0;
4
+ exports.toReconciliationViewSummary = toReconciliationViewSummary;
4
5
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
6
+ function toReconciliationViewSummary(payload) {
7
+ return {
8
+ accounts: {
9
+ done: payload.accounts.done,
10
+ failed: payload.accounts.failed,
11
+ inProgress: payload.accounts.in_progress,
12
+ total: payload.accounts.total,
13
+ },
14
+ accountsToConnectCount: payload.accounts_to_connect_count,
15
+ autoMatched: {
16
+ matchedTxns: payload.auto_matched.matched_txns,
17
+ totalTxns: payload.auto_matched.total_txns,
18
+ },
19
+ needsReview: {
20
+ accountCount: payload.needs_review.account_count,
21
+ txnCount: payload.needs_review.txn_count,
22
+ },
23
+ timeSavedHours: 0,
24
+ timeSavedPercentage: payload.time_saved_percentage,
25
+ progressBar: payload.progress_bar != null
26
+ ? {
27
+ aiPercentageShare: payload.progress_bar.ai_percentage_share,
28
+ completePercentage: payload.progress_bar.complete_percentage,
29
+ humanPercentageShare: payload.progress_bar.human_percentage_share,
30
+ remainingPercentage: payload.progress_bar.remaining_percentage,
31
+ }
32
+ : undefined,
33
+ };
34
+ }
5
35
  exports.RECONCILE_ACTIONS = [
6
36
  'reconcile',
7
37
  'save_reconcile_for_later',
@@ -3,6 +3,7 @@ import { COABalanceType } from '../../commonStateTypes/coaBalance/coaBalanceType
3
3
  import { FetchState } from '../../commonStateTypes/common';
4
4
  import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
5
5
  import { ZeniAPIStatus } from '../../responsePayload';
6
+ import { ZeniDate } from '../../zeniDayJS';
6
7
  import { OpexByVendorReportPayload, OpexByVendorReportSummaryPayload } from './opExByVendorPayload';
7
8
  import { OpExByVendorQuery, OpExByVendorState, OpexByVendorSortKey } from './opExByVendorState';
8
9
  export declare const defaultTimeframePeriodsOpExByVendor: {
@@ -52,6 +53,10 @@ export declare const fetchOpExByVendor: import("@reduxjs/toolkit").ActionCreator
52
53
  }, "opExByVendor/clearOpExByVendorSearch">, updateOpExByVendorPageLimit: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<number | undefined, "opExByVendor/updateOpExByVendorPageLimit">, updateOpExByVendorSearchString: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
53
54
  searchText: string;
54
55
  timeframe: COABalanceMonthQuarterTimeframe;
55
- }, "opExByVendor/updateOpExByVendorSearchString">;
56
+ }, "opExByVendor/updateOpExByVendorSearchString">, refreshOpExByVendorReport: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"opExByVendor/refreshOpExByVendorReport">, refreshOpExByVendorReportSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
57
+ lastRefreshSuccessTime: ZeniDate | undefined;
58
+ }, "opExByVendor/refreshOpExByVendorReportSuccess">, refreshOpExByVendorReportFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
59
+ error: ZeniAPIStatus<Record<string, unknown>>;
60
+ }, "opExByVendor/refreshOpExByVendorReportFailure", never, never>;
56
61
  declare const _default: import("redux").Reducer<OpExByVendorState>;
57
62
  export default _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateOpExByVendorSearchString = exports.updateOpExByVendorPageLimit = exports.clearOpExByVendorSearch = exports.updateOpExByVendorDownloadState = exports.updateOpExByVendorPageFetchInProgress = exports.updateOpExByVendorSortOrSearchInProgress = exports.updateOpExByVendorSort = exports.updateOpExByVendorAdditionalBalancesSelection = exports.clearOpExByVendor = exports.updateOpExByVendorUIState = exports.updateOpExByVendorTimeFrame = exports.updateOpExByVendorReportSummarySuccess = exports.updateOpExByVendorReportSummaryFailure = exports.fetchOpExByVendorReportSummary = exports.updateOpExByVendorReportSuccessForTimeframe = exports.updateOpExByVendorReportFailureForTimeframe = exports.fetchOpExByVendorReportForTimeframe = exports.updateOpExByVendorReportGenerated = exports.fetchOpExByVendor = exports.initialState = exports.initialSearchStringState = exports.defaultTimeframePeriodsOpExByVendor = void 0;
4
+ exports.refreshOpExByVendorReportFailure = exports.refreshOpExByVendorReportSuccess = exports.refreshOpExByVendorReport = exports.updateOpExByVendorSearchString = exports.updateOpExByVendorPageLimit = exports.clearOpExByVendorSearch = exports.updateOpExByVendorDownloadState = exports.updateOpExByVendorPageFetchInProgress = exports.updateOpExByVendorSortOrSearchInProgress = exports.updateOpExByVendorSort = exports.updateOpExByVendorAdditionalBalancesSelection = exports.clearOpExByVendor = exports.updateOpExByVendorUIState = exports.updateOpExByVendorTimeFrame = exports.updateOpExByVendorReportSummarySuccess = exports.updateOpExByVendorReportSummaryFailure = exports.fetchOpExByVendorReportSummary = exports.updateOpExByVendorReportSuccessForTimeframe = exports.updateOpExByVendorReportFailureForTimeframe = exports.fetchOpExByVendorReportForTimeframe = exports.updateOpExByVendorReportGenerated = exports.fetchOpExByVendor = exports.initialState = exports.initialSearchStringState = exports.defaultTimeframePeriodsOpExByVendor = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const coaBalancePayload_1 = require("../../commonPayloadTypes/v2/coaBalancePayload");
7
7
  const viewAndReportPayload_1 = require("../../commonPayloadTypes/viewAndReportPayload");
@@ -26,6 +26,10 @@ exports.initialState = {
26
26
  error: undefined,
27
27
  },
28
28
  },
29
+ refreshStatus: {
30
+ fetchState: 'Not-Started',
31
+ error: undefined,
32
+ },
29
33
  summaryFetchState: {
30
34
  fetchState: 'Not-Started',
31
35
  error: undefined,
@@ -263,12 +267,32 @@ const opexByVendor = (0, toolkit_1.createSlice)({
263
267
  [timeframe]: [],
264
268
  };
265
269
  },
270
+ refreshOpExByVendorReport(draft) {
271
+ draft.refreshStatus = { fetchState: 'In-Progress', error: undefined };
272
+ },
273
+ refreshOpExByVendorReportSuccess(draft, action) {
274
+ draft.refreshStatus = { fetchState: 'Completed', error: undefined };
275
+ if (action.payload.lastRefreshSuccessTime != null) {
276
+ draft.lastRefreshSuccessTime = action.payload.lastRefreshSuccessTime;
277
+ }
278
+ },
279
+ refreshOpExByVendorReportFailure: {
280
+ prepare(error) {
281
+ return { payload: { error } };
282
+ },
283
+ reducer(draft, action) {
284
+ draft.refreshStatus = {
285
+ fetchState: 'Error',
286
+ error: action.payload.error,
287
+ };
288
+ },
289
+ },
266
290
  clearOpExByVendor(draft) {
267
291
  Object.assign(draft, exports.initialState);
268
292
  },
269
293
  },
270
294
  });
271
- _a = opexByVendor.actions, exports.fetchOpExByVendor = _a.fetchOpExByVendor, exports.updateOpExByVendorReportGenerated = _a.updateOpExByVendorReportGenerated, exports.fetchOpExByVendorReportForTimeframe = _a.fetchOpExByVendorReportForTimeframe, exports.updateOpExByVendorReportFailureForTimeframe = _a.updateOpExByVendorReportFailureForTimeframe, exports.updateOpExByVendorReportSuccessForTimeframe = _a.updateOpExByVendorReportSuccessForTimeframe, exports.fetchOpExByVendorReportSummary = _a.fetchOpExByVendorReportSummary, exports.updateOpExByVendorReportSummaryFailure = _a.updateOpExByVendorReportSummaryFailure, exports.updateOpExByVendorReportSummarySuccess = _a.updateOpExByVendorReportSummarySuccess, exports.updateOpExByVendorTimeFrame = _a.updateOpExByVendorTimeFrame, exports.updateOpExByVendorUIState = _a.updateOpExByVendorUIState, exports.clearOpExByVendor = _a.clearOpExByVendor, exports.updateOpExByVendorAdditionalBalancesSelection = _a.updateOpExByVendorAdditionalBalancesSelection, exports.updateOpExByVendorSort = _a.updateOpExByVendorSort, exports.updateOpExByVendorSortOrSearchInProgress = _a.updateOpExByVendorSortOrSearchInProgress, exports.updateOpExByVendorPageFetchInProgress = _a.updateOpExByVendorPageFetchInProgress, exports.updateOpExByVendorDownloadState = _a.updateOpExByVendorDownloadState, exports.clearOpExByVendorSearch = _a.clearOpExByVendorSearch, exports.updateOpExByVendorPageLimit = _a.updateOpExByVendorPageLimit, exports.updateOpExByVendorSearchString = _a.updateOpExByVendorSearchString;
295
+ _a = opexByVendor.actions, exports.fetchOpExByVendor = _a.fetchOpExByVendor, exports.updateOpExByVendorReportGenerated = _a.updateOpExByVendorReportGenerated, exports.fetchOpExByVendorReportForTimeframe = _a.fetchOpExByVendorReportForTimeframe, exports.updateOpExByVendorReportFailureForTimeframe = _a.updateOpExByVendorReportFailureForTimeframe, exports.updateOpExByVendorReportSuccessForTimeframe = _a.updateOpExByVendorReportSuccessForTimeframe, exports.fetchOpExByVendorReportSummary = _a.fetchOpExByVendorReportSummary, exports.updateOpExByVendorReportSummaryFailure = _a.updateOpExByVendorReportSummaryFailure, exports.updateOpExByVendorReportSummarySuccess = _a.updateOpExByVendorReportSummarySuccess, exports.updateOpExByVendorTimeFrame = _a.updateOpExByVendorTimeFrame, exports.updateOpExByVendorUIState = _a.updateOpExByVendorUIState, exports.clearOpExByVendor = _a.clearOpExByVendor, exports.updateOpExByVendorAdditionalBalancesSelection = _a.updateOpExByVendorAdditionalBalancesSelection, exports.updateOpExByVendorSort = _a.updateOpExByVendorSort, exports.updateOpExByVendorSortOrSearchInProgress = _a.updateOpExByVendorSortOrSearchInProgress, exports.updateOpExByVendorPageFetchInProgress = _a.updateOpExByVendorPageFetchInProgress, exports.updateOpExByVendorDownloadState = _a.updateOpExByVendorDownloadState, exports.clearOpExByVendorSearch = _a.clearOpExByVendorSearch, exports.updateOpExByVendorPageLimit = _a.updateOpExByVendorPageLimit, exports.updateOpExByVendorSearchString = _a.updateOpExByVendorSearchString, exports.refreshOpExByVendorReport = _a.refreshOpExByVendorReport, exports.refreshOpExByVendorReportSuccess = _a.refreshOpExByVendorReportSuccess, exports.refreshOpExByVendorReportFailure = _a.refreshOpExByVendorReportFailure;
272
296
  exports.default = opexByVendor.reducer;
273
297
  const doUpdateOpexByVendorReport = (draft, timeframe, reportPayload, queryProps) => {
274
298
  if (reportPayload.status.is_report_generated == null) {
@@ -321,10 +345,9 @@ const doUpdateOpexByVendorReportSummary = (draft, reportPayload) => {
321
345
  const report = (0, viewAndReportPayload_1.mapReportPayloadToReport)(reportPayload);
322
346
  draft.firstMonthOfFY = report.firstMonthOfFY;
323
347
  draft.bookCloseDate = report.bookCloseDate;
324
- draft.lastRefreshSuccessTime =
325
- reportPayload.status.last_refresh_success_time != null
326
- ? (0, zeniDayJS_1.date)(reportPayload.status.last_refresh_success_time)
327
- : undefined;
348
+ if (reportPayload.status.last_refresh_success_time != null) {
349
+ draft.lastRefreshSuccessTime = (0, zeniDayJS_1.date)(reportPayload.status.last_refresh_success_time);
350
+ }
328
351
  draft.totalOpexByVendor = (0, coaBalancePayload_1.combineCOABalanceGrouped)((0, coaBalancePayload_1.mapCOABalanceGroupedPayloadV2ToCOABalanceGrouped)(reportPayload.operating_expenses, reportPayload.currency, 'month'), (0, coaBalancePayload_1.mapCOABalanceGroupedPayloadV2ToCOABalanceGrouped)(reportPayload.operating_expenses, reportPayload.currency, 'quarter'));
329
352
  draft.summaryOpexByVendorKey = mapVendorSummaryBalances(reportPayload.operating_expenses, reportPayload.currency);
330
353
  }
@@ -28,6 +28,7 @@ export interface OpExByVendorReport extends SelectorReport {
28
28
  filter: COABalancesFilter;
29
29
  isReportGenerated: boolean;
30
30
  opexBalances: OpExBalancesByVendor[];
31
+ refreshStatus: FetchStateAndError;
31
32
  reportFetchState: {
32
33
  month: FetchStateAndError;
33
34
  quarter: FetchStateAndError;
@@ -71,6 +71,7 @@ exports.getOpExByVendorReport = (0, toolkit_1.createSelector)((state) => state.o
71
71
  filter,
72
72
  isReportGenerated: opExByVendorState.opExByVendorReportGenerated,
73
73
  lastRefreshSuccessTime: opExByVendorState.lastRefreshSuccessTime,
74
+ refreshStatus: opExByVendorState.refreshStatus,
74
75
  opexBalances,
75
76
  summaryBalances,
76
77
  allTimeframeTicks,
@@ -65,6 +65,7 @@ export interface OpExByVendorState extends Omit<Report, 'dataAvailable'> {
65
65
  quarter: OpexVendorKey[];
66
66
  };
67
67
  opExByVendorReportGenerated: boolean;
68
+ refreshStatus: FetchStateAndError;
68
69
  reportFetchState: {
69
70
  month: FetchStateAndError;
70
71
  quarter: FetchStateAndError;
@@ -0,0 +1,17 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { RootState } from '../../reducer';
3
+ import { ZeniAPIStatus } from '../../responsePayload';
4
+ import { ZeniAPI } from '../../zeniAPI';
5
+ import { refreshOpExByVendorReport, refreshOpExByVendorReportFailure, refreshOpExByVendorReportSuccess } from './opExByVendorReducer';
6
+ export type ActionType = ReturnType<typeof refreshOpExByVendorReport> | ReturnType<typeof refreshOpExByVendorReportSuccess> | ReturnType<typeof refreshOpExByVendorReportFailure>;
7
+ export declare const refreshOpExByVendorReportEpic: (actions$: ActionsObservable<ActionType>, _state: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
8
+ payload: {
9
+ lastRefreshSuccessTime: import("../../zeniDayJS").ZeniDate | undefined;
10
+ };
11
+ type: "opExByVendor/refreshOpExByVendorReportSuccess";
12
+ } | {
13
+ payload: {
14
+ error: ZeniAPIStatus<Record<string, unknown>>;
15
+ };
16
+ type: "opExByVendor/refreshOpExByVendorReportFailure";
17
+ }>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.refreshOpExByVendorReportEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../responsePayload");
7
+ const zeniDayJS_1 = require("../../zeniDayJS");
8
+ const opExByVendorReducer_1 = require("./opExByVendorReducer");
9
+ const refreshOpExByVendorReportEpic = (actions$, _state, zeniAPI) => actions$.pipe((0, operators_1.filter)(opExByVendorReducer_1.refreshOpExByVendorReport.match), (0, operators_1.switchMap)(() => {
10
+ return zeniAPI
11
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reports/operating-expenses-by-vendor/refresh`)
12
+ .pipe((0, operators_1.mergeMap)((response) => {
13
+ if (response.status.code >= 200 && response.status.code < 300) {
14
+ const lastRefreshSuccessTime = response.status.last_refresh_success_time != null
15
+ ? (0, zeniDayJS_1.date)(response.status.last_refresh_success_time)
16
+ : undefined;
17
+ return (0, rxjs_1.of)((0, opExByVendorReducer_1.refreshOpExByVendorReportSuccess)({ lastRefreshSuccessTime }));
18
+ }
19
+ else {
20
+ return (0, rxjs_1.of)((0, opExByVendorReducer_1.refreshOpExByVendorReportFailure)(response.status));
21
+ }
22
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, opExByVendorReducer_1.refreshOpExByVendorReportFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Refresh OpEx by Vendor REST API call errored out: ' +
23
+ JSON.stringify(error))))));
24
+ }));
25
+ exports.refreshOpExByVendorReportEpic = refreshOpExByVendorReportEpic;
@@ -20,7 +20,7 @@ export interface VendorFiling1099ListQuery {
20
20
  sortKey: VendorFiling1099ListViewSortKey;
21
21
  sortOrder: SortOrder;
22
22
  }
23
- declare const toVendorFiling1099ListViewSortKey: (v: string) => "status" | "w9" | "legal_name" | "total" | "tax_classification" | "filing1099type";
23
+ declare const toVendorFiling1099ListViewSortKey: (v: string) => "status" | "w9" | "total" | "legal_name" | "tax_classification" | "filing1099type";
24
24
  export type VendorFiling1099ListViewSortKey = ReturnType<typeof toVendorFiling1099ListViewSortKey>;
25
25
  export type Type1099Download = 'nec' | 'misc' | 'int';
26
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.21",
3
+ "version": "5.1.23-betaNB1",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -79,6 +79,7 @@
79
79
  "ts-prune": "^0.10.3",
80
80
  "ts-unused-exports": "^11.0.1",
81
81
  "typescript": "^5.7.3",
82
+ "vite": "^7.3.5",
82
83
  "vitest": "^4.1.8"
83
84
  },
84
85
  "dependencies": {
@@ -129,7 +130,8 @@
129
130
  "postversion": "git push && git push --tags",
130
131
  "check-dependencies": "node ./scripts/check_dependencies.js",
131
132
  "clean-overrides": "node ./scripts/clean_overrides.js",
132
- "create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
133
+ "create-or-update-release-branch": "chmod +x ./scripts/create_or_update_release_branch.sh && ./scripts/create_or_update_release_branch.sh",
134
+ "bump-versions-master": "chmod +x ./scripts/bump_versions_master.sh && ./scripts/bump_versions_master.sh",
133
135
  "bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
134
136
  "send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
135
137
  "update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",