@zeniai/client-epic-state 5.0.38-betaNB1 → 5.0.39

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.
@@ -8,7 +8,7 @@ import { SortOrder } from '../selectorTypes/sortOrderTypes';
8
8
  import { ReportID } from './viewAndReport';
9
9
  export type AgingDateSelectionType = 'last_month' | 'last_quarter' | 'custom_date';
10
10
  export type AgingReportId = Extract<ReportID, 'accounts_payable_aging' | 'accounts_receivable_aging'>;
11
- declare const toAgingReportSortKey: (v: string) => "vendor" | "customer" | "total" | "current_due" | "due_1-30_days" | "due_31-60_days" | "due_61-90_days" | "due_over_90_days";
11
+ declare const toAgingReportSortKey: (v: string) => "vendor" | "customer" | "current_due" | "due_1-30_days" | "due_31-60_days" | "due_61-90_days" | "due_over_90_days" | "total";
12
12
  export type AgingReportSortKey = ReturnType<typeof toAgingReportSortKey>;
13
13
  export interface AgingReportInvoice {
14
14
  amount: Amount;
@@ -7,20 +7,6 @@ export interface StatementMetaDataPayload {
7
7
  file_id: string;
8
8
  statement_upload_id: string;
9
9
  }
10
- export interface LastReconciledByPayload {
11
- user_email: string;
12
- user_id: ID;
13
- }
14
- export interface LastReconciledPayload {
15
- at: string;
16
- by: LastReconciledByPayload;
17
- for_period_end_date: string;
18
- }
19
- export interface MatchProgressPayload {
20
- matched: number;
21
- percentage: number | null;
22
- total: number;
23
- }
24
10
  export interface ReconciliationDataPayload {
25
11
  account_id: ID;
26
12
  balance_data_status: StatusCodeWithLabelPayload | null;
@@ -35,10 +21,6 @@ export interface ReconciliationDataPayload {
35
21
  error_message: string;
36
22
  } | null;
37
23
  initial_cleared_balance: number | null;
38
- last_reconciled: LastReconciledPayload | null;
39
- match_progress: MatchProgressPayload | null;
40
- needs_review: number;
41
- opening_balance: number | null;
42
24
  payment_account_updated_at: string | null;
43
25
  reconciliation_id: string | null;
44
26
  retry_count: number | null;
@@ -47,7 +29,7 @@ export interface ReconciliationDataPayload {
47
29
  statement_data_status: StatusCodeWithLabelPayload | null;
48
30
  statement_meta_data: StatementMetaDataPayload | null;
49
31
  statement_status: StatusCodeWithLabelPayload | null;
50
- status: StatusCodeWithLabelPayload;
32
+ status: StatusCodeWithLabelPayload | null;
51
33
  transactions: ReconcileReviewTransactionsPayload;
52
34
  update_time: string | null;
53
35
  user_id: ID | null;
@@ -111,27 +111,6 @@ const toAccountReconciliationData = (payload) => {
111
111
  initialClearedBalance: payload.initial_cleared_balance != null
112
112
  ? (0, amount_1.toAmount)(payload.initial_cleared_balance, payload.currency.currency_code, payload.currency.currency_symbol)
113
113
  : undefined,
114
- lastReconciled: payload.last_reconciled != null
115
- ? {
116
- at: (0, zeniDayJS_1.date)(payload.last_reconciled.at),
117
- by: {
118
- userEmail: payload.last_reconciled.by.user_email,
119
- userId: payload.last_reconciled.by.user_id,
120
- },
121
- forPeriodEndDate: (0, zeniDayJS_1.date)(payload.last_reconciled.for_period_end_date),
122
- }
123
- : undefined,
124
- matchProgress: payload.match_progress != null
125
- ? {
126
- matched: payload.match_progress.matched,
127
- percentage: payload.match_progress.percentage,
128
- total: payload.match_progress.total,
129
- }
130
- : undefined,
131
- needsReview: payload.needs_review,
132
- openingBalance: payload.opening_balance != null
133
- ? (0, amount_1.toAmount)(payload.opening_balance, payload.currency.currency_code, payload.currency.currency_symbol)
134
- : undefined,
135
114
  startDate: (0, zeniDayJS_1.date)(payload.start_date),
136
115
  endDate: (0, zeniDayJS_1.date)(payload.end_date),
137
116
  accountUpdatedAt: payload.payment_account_updated_at != null
@@ -7,7 +7,7 @@ import { AccountBase } from '../account/accountState';
7
7
  import { File } from '../file/fileState';
8
8
  import { MatchedTransaction } from '../transaction/stateTypes/reconciliationTransaction';
9
9
  import { User } from '../user/userState';
10
- import { BalanceDataStatusCodeType, LastReconciled, MatchProgress, ReconciliationStatusCodeType, StatementDataStatusCodeType, StatementStatusCodeType, TransactionsToReview } from './accountReconState';
10
+ import { BalanceDataStatusCodeType, ReconciliationStatusCodeType, StatementDataStatusCodeType, StatementStatusCodeType, TransactionsToReview } from './accountReconState';
11
11
  export interface AccountReconciliationEntity {
12
12
  account: AccountBase;
13
13
  currency: Currency;
@@ -31,10 +31,6 @@ export interface AccountReconciliationEntity {
31
31
  errorShort: string;
32
32
  };
33
33
  initialClearedBalance?: Amount;
34
- lastReconciled?: LastReconciled;
35
- matchProgress?: MatchProgress;
36
- needsReview?: number;
37
- openingBalance?: Amount;
38
34
  reconciliationId?: ID;
39
35
  reconciliationStatus?: {
40
36
  code: ReconciliationStatusCodeType;
@@ -36,10 +36,6 @@ exports.getAccountReconByAccountIdAndSelectedPeriod = (0, toolkit_1.createSelect
36
36
  variance: accountRecon.variance,
37
37
  clearedBalance: accountRecon.clearedBalance,
38
38
  initialClearedBalance: accountRecon.initialClearedBalance,
39
- lastReconciled: accountRecon.lastReconciled,
40
- matchProgress: accountRecon.matchProgress,
41
- needsReview: accountRecon.needsReview,
42
- openingBalance: accountRecon.openingBalance,
43
39
  reconciliationId: accountRecon.reconciliationId,
44
40
  user,
45
41
  statementStatus: accountRecon.statementStatus,
@@ -18,20 +18,6 @@ export declare const toStatementStatusCodeType: (v: string) => "not_found" | "up
18
18
  export type StatementStatusCodeType = ReturnType<typeof toStatementStatusCodeType>;
19
19
  export declare const toAccountReconKey: (accountId: ID, selectedPeriod: MonthYearPeriod) => string;
20
20
  export type AccountReconKey = ReturnType<typeof toAccountReconKey>;
21
- export interface LastReconciledByUser {
22
- userEmail: string;
23
- userId: ID;
24
- }
25
- export interface LastReconciled {
26
- at: ZeniDate;
27
- by: LastReconciledByUser;
28
- forPeriodEndDate: ZeniDate;
29
- }
30
- export interface MatchProgress {
31
- matched: number;
32
- percentage: number | null;
33
- total: number;
34
- }
35
21
  export interface AccountReconState {
36
22
  accountReconByAccountReconKey: Record<AccountReconKey, AccountReconciliationData>;
37
23
  }
@@ -58,10 +44,6 @@ export interface AccountReconciliationData {
58
44
  errorShort: string;
59
45
  };
60
46
  initialClearedBalance?: Amount;
61
- lastReconciled?: LastReconciled;
62
- matchProgress?: MatchProgress;
63
- needsReview?: number;
64
- openingBalance?: Amount;
65
47
  reconciliationId?: ID;
66
48
  reconciliationStatus?: {
67
49
  code: ReconciliationStatusCodeType;
@@ -106,27 +106,6 @@ export const toAccountReconciliationData = (payload) => {
106
106
  initialClearedBalance: payload.initial_cleared_balance != null
107
107
  ? toAmount(payload.initial_cleared_balance, payload.currency.currency_code, payload.currency.currency_symbol)
108
108
  : undefined,
109
- lastReconciled: payload.last_reconciled != null
110
- ? {
111
- at: date(payload.last_reconciled.at),
112
- by: {
113
- userEmail: payload.last_reconciled.by.user_email,
114
- userId: payload.last_reconciled.by.user_id,
115
- },
116
- forPeriodEndDate: date(payload.last_reconciled.for_period_end_date),
117
- }
118
- : undefined,
119
- matchProgress: payload.match_progress != null
120
- ? {
121
- matched: payload.match_progress.matched,
122
- percentage: payload.match_progress.percentage,
123
- total: payload.match_progress.total,
124
- }
125
- : undefined,
126
- needsReview: payload.needs_review,
127
- openingBalance: payload.opening_balance != null
128
- ? toAmount(payload.opening_balance, payload.currency.currency_code, payload.currency.currency_symbol)
129
- : undefined,
130
109
  startDate: date(payload.start_date),
131
110
  endDate: date(payload.end_date),
132
111
  accountUpdatedAt: payload.payment_account_updated_at != null
@@ -33,10 +33,6 @@ export const getAccountReconByAccountIdAndSelectedPeriod = createSelector((state
33
33
  variance: accountRecon.variance,
34
34
  clearedBalance: accountRecon.clearedBalance,
35
35
  initialClearedBalance: accountRecon.initialClearedBalance,
36
- lastReconciled: accountRecon.lastReconciled,
37
- matchProgress: accountRecon.matchProgress,
38
- needsReview: accountRecon.needsReview,
39
- openingBalance: accountRecon.openingBalance,
40
36
  reconciliationId: accountRecon.reconciliationId,
41
37
  user,
42
38
  statementStatus: accountRecon.statementStatus,
@@ -2,7 +2,6 @@ import { createSlice } from '@reduxjs/toolkit';
2
2
  import { toMonthYearPeriodId, } from '../../../commonStateTypes/timePeriod';
3
3
  import { toReconciliationAccountSource } from '../../../entity/account/accountState';
4
4
  import { toBankStatusCodeType } from '../../../entity/accountRecon/accountReconState';
5
- import { toReconciliationViewSummary, } from '../types/reconciliationViewState';
6
5
  // Initial state
7
6
  export const initialReconciliationTabsState = {
8
7
  balances: {
@@ -76,7 +75,6 @@ export const initialState = {
76
75
  },
77
76
  },
78
77
  excludedAccountIDs: [],
79
- summary: undefined,
80
78
  };
81
79
  // Create slice with reducers
82
80
  const expenseAutomationReconciliationView = createSlice({
@@ -145,7 +143,7 @@ const expenseAutomationReconciliationView = createSlice({
145
143
  fetchReconciliationSuccess: {
146
144
  reducer(draft, action) {
147
145
  if (action.payload.accountId == null) {
148
- updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground, action.payload.reconciliation.excluded_accounts ?? [], action.payload.reconciliation.summary);
146
+ updateAllReconciliation(draft, action.payload.reconciliation.accounts, action.payload.selectedPeriod, action.payload.reconciliation.reconciliation, action.payload.refreshViewInBackground, action.payload.reconciliation.excluded_accounts ?? []);
149
147
  }
150
148
  else if (action.payload.reconciliation.reconciliation.length > 0 &&
151
149
  action.payload.reconciliation.accounts.length > 0) {
@@ -529,7 +527,7 @@ const expenseAutomationReconciliationView = createSlice({
529
527
  export const { fetchReconciliation, fetchReconciliationFailure, fetchReconciliationSuccess, saveReconciliationDetail, saveReconciliationDetailFailure, updateSelectedAccountId, setConnectionInProgressForAccount, setStatementParseInProgress, updateReconcileTabLocalData, updateReconcileTabListSortState, updateReconcileTabListScrollState, saveReconciliationDetailSuccess, updateSelectedTab, updateBalancesLocalData, initialiseLocalDataForSelectedAccountId, clearExpenseAutomationReconciliationView, updateSelectedDrawerAccountId, updateReviewTabSortState, initializeReconciliationReviewTabLocalData, updateReviewTabLocalData, saveReconciliationReview, updateSaveReconciliationReviewFetchStatus, updateReconListScrollPosition, updateAccountReconciliationLocalData, deleteAccountStatement, deleteAccountStatementSuccess, deleteAccountStatementFailure, excludeAccountFromReconciliation, excludeAccountFromReconciliationSuccess, excludeAccountFromReconciliationFailure, includeAccountInReconciliation, includeAccountInReconciliationSuccess, includeAccountInReconciliationFailure, uploadAccountStatement, uploadAccountStatementSuccess, uploadAccountStatementFailure, updateStatementUploadChosen, updateNodeCollapseState, } = expenseAutomationReconciliationView.actions;
530
528
  // Export reducer
531
529
  export default expenseAutomationReconciliationView.reducer;
532
- function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground, excludedAccounts, summary) {
530
+ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliationData, refreshViewInBackground, excludedAccounts) {
533
531
  draft.excludedAccountIDs = excludedAccounts.map((ea) => ea.account_id);
534
532
  draft.excludedAccountExclusionInfo = {};
535
533
  excludedAccounts.forEach((ea) => {
@@ -611,9 +609,6 @@ function updateAllReconciliation(draft, accounts, selectedPeriod, reconciliation
611
609
  draft.fetchState = 'Completed';
612
610
  draft.error = undefined;
613
611
  }
614
- if (summary !== undefined) {
615
- draft.summary = toReconciliationViewSummary(summary);
616
- }
617
612
  }
618
613
  function updateReconciliationByAccountID(draft, accounts, selectedPeriod, accountId, reconciliationData, refreshViewInBackground) {
619
614
  const oldRecord = draft.accountReconciliationRecordsBySelectedPeriod[toMonthYearPeriodId(selectedPeriod)].reconciliationByAccountID[accountId];
@@ -115,7 +115,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
115
115
  excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
116
116
  includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
117
117
  excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
118
- summary: reconciliationViewState.summary,
119
118
  };
120
119
  }
121
120
  const allAccountIDs = accountReconForMonthYearPeriod.accountIDs;
@@ -424,7 +423,6 @@ export const getExpenseAutomationReconciliationView = createSelector((state) =>
424
423
  excludeAccountFetchState: reconciliationViewState.actionFetchState.excludeAccountFetch,
425
424
  includeAccountFetchState: reconciliationViewState.actionFetchState.includeAccountFetch,
426
425
  excludedAccountIDs: reconciliationViewState.excludedAccountIDs,
427
- summary: reconciliationViewState.summary,
428
426
  };
429
427
  });
430
428
  export const isAccountReconReport = (reportId) => {
@@ -1,24 +1,4 @@
1
1
  import { stringToUnion } from '../../../commonStateTypes/stringToUnion';
2
- export function toReconciliationViewSummary(payload) {
3
- return {
4
- accounts: {
5
- done: payload.accounts.done,
6
- failed: payload.accounts.failed,
7
- inProgress: payload.accounts.in_progress,
8
- total: payload.accounts.total,
9
- },
10
- accountsToConnectCount: payload.accounts_to_connect_count,
11
- autoMatched: {
12
- matchedTxns: payload.auto_matched.matched_txns,
13
- totalTxns: payload.auto_matched.total_txns,
14
- },
15
- needsReview: {
16
- accountCount: payload.needs_review.account_count,
17
- txnCount: payload.needs_review.txn_count,
18
- },
19
- timeSavedPercentage: payload.time_saved_percentage,
20
- };
21
- }
22
2
  export const RECONCILE_ACTIONS = [
23
3
  'reconcile',
24
4
  'save_reconcile_for_later',