@zeniai/client-epic-state 4.19.81-betaRR0 → 4.19.81-betaSS2

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 (22) hide show
  1. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +35 -0
  2. package/lib/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  3. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
  4. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  5. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +13 -0
  6. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  7. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  8. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +5 -0
  9. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  10. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
  11. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -11
  12. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  13. package/lib/index.d.ts +2 -1
  14. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
  15. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +5 -0
  16. package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  17. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  18. package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
  19. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -11
  20. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  21. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  22. package/package.json +1 -1
@@ -13,6 +13,39 @@ export interface JEScheduleOtherAttributesPayload {
13
13
  asset_id?: string | null;
14
14
  starting_balance?: number | null;
15
15
  }
16
+ export interface JEScheduleAISummaryFieldPayload {
17
+ confidence: number;
18
+ reasoning: string;
19
+ predicted_value?: number | string;
20
+ }
21
+ export interface JEScheduleAISummariesPayload {
22
+ credit_account?: JEScheduleAISummaryFieldPayload;
23
+ credit_accounting_class?: JEScheduleAISummaryFieldPayload;
24
+ debit_account?: JEScheduleAISummaryFieldPayload;
25
+ debit_accounting_class?: JEScheduleAISummaryFieldPayload;
26
+ period?: JEScheduleAISummaryFieldPayload;
27
+ posting_date?: JEScheduleAISummaryFieldPayload;
28
+ }
29
+ export interface JEScheduleRecommendationsPayload {
30
+ amortization_days?: number | null;
31
+ amortization_months_estimate?: number | null;
32
+ credit_account_confidence?: number;
33
+ credit_account_id?: string | null;
34
+ credit_accounting_class_id?: string | null;
35
+ credit_class_confidence?: number;
36
+ debit_account_confidence?: number;
37
+ debit_account_id?: string | null;
38
+ debit_accounting_class_id?: string | null;
39
+ debit_class_confidence?: number;
40
+ end_date?: string | null;
41
+ je_schedule_type?: string | null;
42
+ period?: number | null;
43
+ period_confidence?: number;
44
+ posting_date?: string | null;
45
+ similar_transactions?: unknown[];
46
+ start_date?: string | null;
47
+ starting_month?: string | null;
48
+ }
16
49
  export interface JEScheduledTransactionPayload {
17
50
  balance: number | null;
18
51
  base_transaction: ScheduleTransactionPayload;
@@ -35,7 +68,9 @@ export interface JEScheduledTransactionPayload {
35
68
  status: StatusCodeWithLabelPayload;
36
69
  updated_by: UserPayload;
37
70
  vendor: VendorPayload;
71
+ ai_summaries?: JEScheduleAISummariesPayload;
38
72
  end_date?: string | null;
73
+ recommendations?: JEScheduleRecommendationsPayload;
39
74
  updated_at?: string | null;
40
75
  }
41
76
  export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTransactionPayload, 'base_transaction' | 'je_schedule_id' | 'je_schedule_type'> {
@@ -144,6 +144,49 @@ function toJEScheduleOtherAttributes(payload) {
144
144
  assetId: payload.asset_id ?? undefined,
145
145
  };
146
146
  }
147
+ function toJEScheduleAIRecommendations(payload) {
148
+ if (payload == null) {
149
+ return undefined;
150
+ }
151
+ const result = {};
152
+ if (payload.debit_account != null) {
153
+ result.debitAccount = {
154
+ confidence: payload.debit_account.confidence,
155
+ reasoning: payload.debit_account.reasoning,
156
+ };
157
+ }
158
+ if (payload.credit_account != null) {
159
+ result.creditAccount = {
160
+ confidence: payload.credit_account.confidence,
161
+ reasoning: payload.credit_account.reasoning,
162
+ };
163
+ }
164
+ if (payload.debit_accounting_class != null) {
165
+ result.debitClass = {
166
+ confidence: payload.debit_accounting_class.confidence,
167
+ reasoning: payload.debit_accounting_class.reasoning,
168
+ };
169
+ }
170
+ if (payload.credit_accounting_class != null) {
171
+ result.creditClass = {
172
+ confidence: payload.credit_accounting_class.confidence,
173
+ reasoning: payload.credit_accounting_class.reasoning,
174
+ };
175
+ }
176
+ if (payload.period != null) {
177
+ result.period = {
178
+ confidence: payload.period.confidence,
179
+ reasoning: payload.period.reasoning,
180
+ };
181
+ }
182
+ if (payload.posting_date != null) {
183
+ result.postingDate = {
184
+ confidence: payload.posting_date.confidence,
185
+ reasoning: payload.posting_date.reasoning,
186
+ };
187
+ }
188
+ return Object.keys(result).length > 0 ? result : undefined;
189
+ }
147
190
  function toJEScheduledTransaction(payload) {
148
191
  return {
149
192
  jeScheduleId: payload.je_schedule_id ?? undefined,
@@ -185,6 +228,7 @@ function toJEScheduledTransaction(payload) {
185
228
  ? toJEScheduleOtherAttributes(payload.other_attributes)
186
229
  : {},
187
230
  scheduledJournalEntry: [],
231
+ aiRecommendations: toJEScheduleAIRecommendations(payload.ai_summaries),
188
232
  };
189
233
  }
190
234
  function toJEAccruedScheduledTransaction(payload) {
@@ -9,7 +9,7 @@ import { ScheduleTransaction } from '../transaction/stateTypes/scheduleTransacti
9
9
  import { TransactionID } from '../transaction/stateTypes/transaction';
10
10
  import { User } from '../user/userState';
11
11
  import { Vendor } from '../vendor/vendorState';
12
- import { JEScheduleOtherAttributes, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
12
+ import { JEScheduleAIRecommendations, JEScheduleOtherAttributes, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
13
13
  import { JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleTypes } from './jeSchedulesTypes';
14
14
  export interface ScheduledJournalEntry {
15
15
  error: JournalEntryErrorCodeType[];
@@ -59,6 +59,7 @@ export interface JEScheduledTransaction {
59
59
  scheduledJournalEntry: ScheduledJournalEntry[];
60
60
  status: ScheduleStatus;
61
61
  vendor: Vendor;
62
+ aiRecommendations?: JEScheduleAIRecommendations;
62
63
  balanceAsOfToday?: Amount;
63
64
  dayOfPostingDate?: ScheduleDaysOfMonth;
64
65
  endDate?: ZeniDate;
@@ -77,7 +77,7 @@ exports.getJEAccruedScheduleByJEScheduleKey = getJEAccruedScheduleByJEScheduleKe
77
77
  const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
78
78
  const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
79
79
  const jeScheduleTransactionState = (0, get_1.default)(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
80
- const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, } = jeScheduleTransactionState;
80
+ const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiRecommendations, } = jeScheduleTransactionState;
81
81
  const vendorDetails = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
82
82
  if (vendorDetails == null) {
83
83
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
@@ -134,6 +134,7 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
134
134
  account: accountDebit,
135
135
  },
136
136
  scheduledJournalEntry,
137
+ aiRecommendations,
137
138
  };
138
139
  };
139
140
  exports.getJEScheduledTransactionByJEScheduleTransactionKey = getJEScheduledTransactionByJEScheduleTransactionKey;
@@ -13,6 +13,18 @@ export interface ScheduleJournalStatusCode {
13
13
  code: ScheduleJournalEntryStatusCodeType;
14
14
  label: string;
15
15
  }
16
+ export interface JEScheduleFieldRecommendation {
17
+ confidence: number;
18
+ reasoning: string;
19
+ }
20
+ export interface JEScheduleAIRecommendations {
21
+ creditAccount?: JEScheduleFieldRecommendation;
22
+ creditClass?: JEScheduleFieldRecommendation;
23
+ debitAccount?: JEScheduleFieldRecommendation;
24
+ debitClass?: JEScheduleFieldRecommendation;
25
+ period?: JEScheduleFieldRecommendation;
26
+ postingDate?: JEScheduleFieldRecommendation;
27
+ }
16
28
  export interface JEScheduleOtherAttributes {
17
29
  assetId?: string;
18
30
  startingBalance?: Amount;
@@ -57,6 +69,7 @@ export interface JEScheduledTransactionState {
57
69
  scheduledJournalEntry: ScheduledJournalEntryState[];
58
70
  status: ScheduleStatus;
59
71
  vendorId: ID;
72
+ aiRecommendations?: JEScheduleAIRecommendations;
60
73
  balanceAsOfToday?: number;
61
74
  dayOfPostingDate?: ScheduleDaysOfMonth;
62
75
  endDate?: ZeniDate;
@@ -134,6 +134,49 @@ function toJEScheduleOtherAttributes(payload) {
134
134
  assetId: payload.asset_id ?? undefined,
135
135
  };
136
136
  }
137
+ function toJEScheduleAIRecommendations(payload) {
138
+ if (payload == null) {
139
+ return undefined;
140
+ }
141
+ const result = {};
142
+ if (payload.debit_account != null) {
143
+ result.debitAccount = {
144
+ confidence: payload.debit_account.confidence,
145
+ reasoning: payload.debit_account.reasoning,
146
+ };
147
+ }
148
+ if (payload.credit_account != null) {
149
+ result.creditAccount = {
150
+ confidence: payload.credit_account.confidence,
151
+ reasoning: payload.credit_account.reasoning,
152
+ };
153
+ }
154
+ if (payload.debit_accounting_class != null) {
155
+ result.debitClass = {
156
+ confidence: payload.debit_accounting_class.confidence,
157
+ reasoning: payload.debit_accounting_class.reasoning,
158
+ };
159
+ }
160
+ if (payload.credit_accounting_class != null) {
161
+ result.creditClass = {
162
+ confidence: payload.credit_accounting_class.confidence,
163
+ reasoning: payload.credit_accounting_class.reasoning,
164
+ };
165
+ }
166
+ if (payload.period != null) {
167
+ result.period = {
168
+ confidence: payload.period.confidence,
169
+ reasoning: payload.period.reasoning,
170
+ };
171
+ }
172
+ if (payload.posting_date != null) {
173
+ result.postingDate = {
174
+ confidence: payload.posting_date.confidence,
175
+ reasoning: payload.posting_date.reasoning,
176
+ };
177
+ }
178
+ return Object.keys(result).length > 0 ? result : undefined;
179
+ }
137
180
  export function toJEScheduledTransaction(payload) {
138
181
  return {
139
182
  jeScheduleId: payload.je_schedule_id ?? undefined,
@@ -175,6 +218,7 @@ export function toJEScheduledTransaction(payload) {
175
218
  ? toJEScheduleOtherAttributes(payload.other_attributes)
176
219
  : {},
177
220
  scheduledJournalEntry: [],
221
+ aiRecommendations: toJEScheduleAIRecommendations(payload.ai_summaries),
178
222
  };
179
223
  }
180
224
  export function toJEAccruedScheduledTransaction(payload) {
@@ -70,7 +70,7 @@ export const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
70
70
  export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
71
71
  const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
72
72
  const jeScheduleTransactionState = recordGet(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
73
- const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, } = jeScheduleTransactionState;
73
+ const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiRecommendations, } = jeScheduleTransactionState;
74
74
  const vendorDetails = getVendorByVendorId(vendorState, vendorId);
75
75
  if (vendorDetails == null) {
76
76
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
@@ -127,5 +127,6 @@ export const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTr
127
127
  account: accountDebit,
128
128
  },
129
129
  scheduledJournalEntry,
130
+ aiRecommendations,
130
131
  };
131
132
  };
@@ -60,6 +60,9 @@ export function getExpenseAutomationJESchedulesView(state) {
60
60
  failedJeScheduledTransaction.push(jeScheduleDetails);
61
61
  });
62
62
  const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
63
+ const ongoingSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing');
64
+ const completedSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
65
+ schedule.status.code === 'marked_as_completed');
63
66
  const resolveSchedules = [];
64
67
  failedJeScheduledTransaction.forEach((schedule) => {
65
68
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
@@ -79,7 +82,9 @@ export function getExpenseAutomationJESchedulesView(state) {
79
82
  allAccountList: filteredAccounts,
80
83
  accountListNestedAccountHierarchy,
81
84
  allClassList: allClasses,
85
+ completedSchedules,
82
86
  draftSchedules,
87
+ ongoingSchedules,
83
88
  resolveSchedules: resolveSchedules,
84
89
  accountSettingsView,
85
90
  postStatusById: postStatusById,
@@ -416,14 +416,6 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
416
416
  transactionsWithNoSortKeyValue.push(transaction);
417
417
  }
418
418
  break;
419
- case 'invoiceNumber':
420
- if (Boolean(transaction.documentId) === true) {
421
- transactionsWithSortKeyValue.push(transaction);
422
- }
423
- else {
424
- transactionsWithNoSortKeyValue.push(transaction);
425
- }
426
- break;
427
419
  case 'dueDate':
428
420
  if (currentTab === 'draft') {
429
421
  if (Boolean(transaction.dueDate) === true) {
@@ -526,8 +518,6 @@ export const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions)
526
518
  return transaction.totalAmountInUSD?.amount ?? 0;
527
519
  case 'paymentMethod':
528
520
  return transaction.billPayInfo.billPaymentMethodType.name;
529
- case 'invoiceNumber':
530
- return transaction.documentId;
531
521
  }
532
522
  }, getColumnWiseSortOrder(sortOrder));
533
523
  return [
@@ -43,7 +43,6 @@ const ALL_BILL_PAY_SORT_KEYS = [
43
43
  'invoiceDate',
44
44
  'name',
45
45
  'paymentMethod',
46
- 'invoiceNumber',
47
46
  ];
48
47
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
48
  const toBillPaySortKeyType = (v) => stringToUnion(v, ALL_BILL_PAY_SORT_KEYS);
@@ -415,14 +415,6 @@ export const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements
415
415
  reimbursementsWithNoSortKeyValue.push(reimbursement);
416
416
  }
417
417
  break;
418
- case 'createdBy':
419
- if (Boolean(reimbursement.createdBy) === true) {
420
- reimbursementsWithSortKeyValue.push(reimbursement);
421
- }
422
- else {
423
- reimbursementsWithNoSortKeyValue.push(reimbursement);
424
- }
425
- break;
426
418
  }
427
419
  });
428
420
  const getColumnWiseSortOrder = (sortOrder) => {
@@ -430,7 +422,6 @@ export const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements
430
422
  case 'reportName':
431
423
  case 'type':
432
424
  case 'status':
433
- case 'createdBy':
434
425
  return sortOrder === 'ascending' ? 'asc' : 'desc';
435
426
  default:
436
427
  return sortOrder === 'ascending' ? 'desc' : 'asc';
@@ -450,8 +441,6 @@ export const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements
450
441
  return getStatusPerTab(reimbursement);
451
442
  case 'amount':
452
443
  return reimbursement.amount.amount ?? 0;
453
- case 'createdBy':
454
- return reimbursement.createdBy.toLowerCase();
455
444
  }
456
445
  }, getColumnWiseSortOrder(sortOrder));
457
446
  return [
@@ -55,7 +55,6 @@ export const toRemiSubTabUnderScoreType = (v) => stringToUnion(v, REMI_SUB_TAB_U
55
55
  const ALL_REIMBURSEMENT_SORT_KEYS = [
56
56
  'reportName',
57
57
  'submittedOn',
58
- 'createdBy',
59
58
  'type',
60
59
  'status',
61
60
  'amount',
package/lib/index.d.ts CHANGED
@@ -91,6 +91,7 @@ import { TrendChangeType } from './entity/insights/insightPayload';
91
91
  import { Insight } from './entity/insights/insightState';
92
92
  import { InsightSummary } from './entity/insights/insightSummary';
93
93
  import { JEAccruedSchedule, JEScheduledTransaction, ScheduledJournalEntry } from './entity/jeSchedules/jeSchedulesSelector';
94
+ import { JEScheduleAIRecommendations, JEScheduleFieldRecommendation } from './entity/jeSchedules/jeSchedulesState';
94
95
  import { ALL_SCHEDULES_TYPES, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes, toScheduleTypesType, toScheduleTypesTypeStrict } from './entity/jeSchedules/jeSchedulesTypes';
95
96
  import { Merchant } from './entity/merchant/merchant';
96
97
  import { ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, MonthCloseCheckMetrics, MonthEndAuditSummary, MonthEndCloseCheck, MonthEndCloseCheckFrequency } from './entity/monthEndCloseChecks/monthEndCloseChecksState';
@@ -826,7 +827,7 @@ export { fetchApAgingDetail, AgingReportInvoice, ApAgingDetail, getApAgingDetail
826
827
  export { LinkBillExpenseKey };
827
828
  export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryExpenseAutomationJESchedule, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
828
829
  export { createNewSchedulesAccrued, deleteScheduleAccruedDetail, cancelScheduleAccruedJournalEntry, fetchScheduleAccruedDetails, fetchScheduleAccruedDetailsPage, resetJEAccruedLinkInLocalData, saveScheduleAccruedDetails, updateAmountsInScheduleAccruedDetail, updatedJEAccruedLinkWithRecommendedLocalData, updatedJELinkInLocalDataAccruedExpenses, fetchRecommendedTransactionRowIndex, clearSelectedJELinkRowIndex, updateLinkBillExpenseLocalData, updateScheduleAccruedDetailsLocalData, updateSelectedJEAccruedScheduleKey, resetSelectedJEAccruedScheduleKey, resetAccruedDetailNewScheduleState, };
829
- export { JEScheduleKey, JEScheduleTransactionKey, ALL_SCHEDULES_TYPES, JEScheduledTransaction, JEAccruedSchedule, ScheduleTypes, ScheduleJournalEntryStatusCodeType, ScheduleListReport, ScheduleAccruedListReport, getScheduleListReport, getAccruedScheduleListReport, ScheduleSubTabType, ScheduleListSortKey, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, ScheduleListLocalData, ScheduleDetailsLocalDataFixedAssets, ScheduleDetailsLocalDataAccruedExpenses, ScheduleDetailsView, ScheduleAccruedDetailsView, LinkBillExpenseView, LinkBillExpenseLocalData, JEScheduleDetailsLocalData, ScheduleDetailsLocalData, toScheduleSubTabType, ScheduleStatusCodeType, JournalEntryErrorCodeType, ScheduleTransaction, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, ScheduleDetailSortKey, ScheduledJournalEntry, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, JETransactionLink, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, DownloadJEScheduleTabOptions, updatedSelectedJELinkRowIndex, ScheduleListTabsFileType, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, ScheduleDetailUIState, resetJELinkInLocalData, JEScheduledTransactionWithBalance, JEScheduleWithBalance, JELinkType, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, VendorTabViewTabType, getVendorTabView, VendorTabViewSelectorView, };
830
+ export { JEScheduleKey, JEScheduleTransactionKey, ALL_SCHEDULES_TYPES, JEScheduledTransaction, JEAccruedSchedule, JEScheduleAIRecommendations, JEScheduleFieldRecommendation, ScheduleTypes, ScheduleJournalEntryStatusCodeType, ScheduleListReport, ScheduleAccruedListReport, getScheduleListReport, getAccruedScheduleListReport, ScheduleSubTabType, ScheduleListSortKey, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, ScheduleListLocalData, ScheduleDetailsLocalDataFixedAssets, ScheduleDetailsLocalDataAccruedExpenses, ScheduleDetailsView, ScheduleAccruedDetailsView, LinkBillExpenseView, LinkBillExpenseLocalData, JEScheduleDetailsLocalData, ScheduleDetailsLocalData, toScheduleSubTabType, ScheduleStatusCodeType, JournalEntryErrorCodeType, ScheduleTransaction, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, ScheduleDetailSortKey, ScheduledJournalEntry, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, JETransactionLink, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, DownloadJEScheduleTabOptions, updatedSelectedJELinkRowIndex, ScheduleListTabsFileType, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, ScheduleDetailUIState, resetJELinkInLocalData, JEScheduledTransactionWithBalance, JEScheduleWithBalance, JELinkType, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, VendorTabViewTabType, getVendorTabView, VendorTabViewSelectorView, };
830
831
  export { GlobalMerchant, GlobalMerchantBase, TenantMerchant };
831
832
  export { ReviewStatus, VendorTransactionAttachment, VendorTransactionAttachmentPayload, VendorFirstReviewViewSelectorView, VendorFirstReviewViewLocalData, VendorFirstReviewSelectorView, VendorFirstReviewSelectorAttachmentView, VendorFirstReviewViewUIState, VendorFirstReviewViewColumnKey, GlobalMerchantAutoCompleteView, VendorReviewRowCurrentSelection, toVendorFirstReviewViewColumnKeyType, RecommendedNonExistingGlobalMerchant, getGlobalMerchantAutoCompleteResults, VendorReviewRecommendationViewState, GlobalMerchantType, getVendorFirstReviewView, getVendorFirstReviewAttachmentView, fetchVendorFirstReviewView, fetchVendorFirstReviewAttachments, updateVendorFirstReviewViewScrollYOffset, resetVendorFirstReviewLocalData, updateVendorFirstReviewViewPageToken, clearRecentlySavedErroredVendorData, saveVendorFirstReviewView, updateVendorFirstReviewViewLocalData, updateVendorFirstReviewSortUiState, fetchGlobalMerchantAutoCompleteView, clearGlobalMerchantAutoCompleteResults, GlobalVendorReviewRowCurrentSelection, FirstReviewPageCurrentSelectionByColumn, updateReviewVendorDetailLocalData, saveVendorDetailsView, getVendorDetailSelectorView, FirstReviewVendorDetailSelectorView, VendorViewLocalData, };
832
833
  export { fetchGlobalMerchantRecommendation, createGlobalMerchant, updateCreateGlobalMerchantLocalData, clearGlobalMerchantView, getGlobalMerchantView, GlobalMerchantViewSelectorView, GlobalMerchantViewState, NewGlobalMerchantData, NewGlobalMerchantCurrentSelection, };
@@ -18,10 +18,12 @@ export interface ExpenseAutomationJESchedulesViewSelector extends SelectorView {
18
18
  allDepreciationAccountList: AccountBase[];
19
19
  allDepreciationAccountListNestedAccountHierarchy: NestedAccountHierarchyForReport[];
20
20
  classListNestedAccountHierarchy: NestedClassHierarchyForReport[];
21
+ completedSchedules: JEScheduledTransaction[];
21
22
  completionStatus: CompletionStatusType;
22
23
  draftSchedules: JEScheduledTransaction[];
23
24
  ignoreStatusById: Record<JEScheduleTransactionKey, FetchStateAndError>;
24
25
  jeScheduleLocalDataById: Record<ID, JEScheduleLocalData>;
26
+ ongoingSchedules: JEScheduledTransaction[];
25
27
  postStatusById: Record<ID, FetchStateAndError>;
26
28
  refreshStatus: FetchStateAndError;
27
29
  resolveSchedules: JEScheduledTransactionWithFailedEntries[];
@@ -66,6 +66,9 @@ function getExpenseAutomationJESchedulesView(state) {
66
66
  failedJeScheduledTransaction.push(jeScheduleDetails);
67
67
  });
68
68
  const draftSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'draft');
69
+ const ongoingSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'ongoing');
70
+ const completedSchedules = jeScheduledTransaction.filter((schedule) => schedule.status.code === 'completed' ||
71
+ schedule.status.code === 'marked_as_completed');
69
72
  const resolveSchedules = [];
70
73
  failedJeScheduledTransaction.forEach((schedule) => {
71
74
  schedule.scheduledJournalEntry.forEach((journalEntry) => {
@@ -85,7 +88,9 @@ function getExpenseAutomationJESchedulesView(state) {
85
88
  allAccountList: filteredAccounts,
86
89
  accountListNestedAccountHierarchy,
87
90
  allClassList: allClasses,
91
+ completedSchedules,
88
92
  draftSchedules,
93
+ ongoingSchedules,
89
94
  resolveSchedules: resolveSchedules,
90
95
  accountSettingsView,
91
96
  postStatusById: postStatusById,
@@ -424,14 +424,6 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
424
424
  transactionsWithNoSortKeyValue.push(transaction);
425
425
  }
426
426
  break;
427
- case 'invoiceNumber':
428
- if (Boolean(transaction.documentId) === true) {
429
- transactionsWithSortKeyValue.push(transaction);
430
- }
431
- else {
432
- transactionsWithNoSortKeyValue.push(transaction);
433
- }
434
- break;
435
427
  case 'dueDate':
436
428
  if (currentTab === 'draft') {
437
429
  if (Boolean(transaction.dueDate) === true) {
@@ -534,8 +526,6 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
534
526
  return transaction.totalAmountInUSD?.amount ?? 0;
535
527
  case 'paymentMethod':
536
528
  return transaction.billPayInfo.billPaymentMethodType.name;
537
- case 'invoiceNumber':
538
- return transaction.documentId;
539
529
  }
540
530
  }, getColumnWiseSortOrder(sortOrder));
541
531
  return [
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
37
37
  export type BillTab = ReturnType<typeof toBillTabType>;
38
38
  declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
39
39
  export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
40
- declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
40
+ declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
41
41
  export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
42
42
  export interface BillPayFilters {
43
43
  categories: BillPayFilterCategory[];
@@ -47,7 +47,6 @@ const ALL_BILL_PAY_SORT_KEYS = [
47
47
  'invoiceDate',
48
48
  'name',
49
49
  'paymentMethod',
50
- 'invoiceNumber',
51
50
  ];
52
51
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
53
52
  const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
@@ -423,14 +423,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
423
423
  reimbursementsWithNoSortKeyValue.push(reimbursement);
424
424
  }
425
425
  break;
426
- case 'createdBy':
427
- if (Boolean(reimbursement.createdBy) === true) {
428
- reimbursementsWithSortKeyValue.push(reimbursement);
429
- }
430
- else {
431
- reimbursementsWithNoSortKeyValue.push(reimbursement);
432
- }
433
- break;
434
426
  }
435
427
  });
436
428
  const getColumnWiseSortOrder = (sortOrder) => {
@@ -438,7 +430,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
438
430
  case 'reportName':
439
431
  case 'type':
440
432
  case 'status':
441
- case 'createdBy':
442
433
  return sortOrder === 'ascending' ? 'asc' : 'desc';
443
434
  default:
444
435
  return sortOrder === 'ascending' ? 'desc' : 'asc';
@@ -458,8 +449,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
458
449
  return getStatusPerTab(reimbursement);
459
450
  case 'amount':
460
451
  return reimbursement.amount.amount ?? 0;
461
- case 'createdBy':
462
- return reimbursement.createdBy.toLowerCase();
463
452
  }
464
453
  }, getColumnWiseSortOrder(sortOrder));
465
454
  return [
@@ -38,7 +38,7 @@ export declare const toRemiSubTabTypeStrict: (v: string) => "rejected" | "failed
38
38
  export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
39
39
  export declare const toRemiSubTabUnderScoreType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
40
40
  export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
41
- declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "createdBy" | "submittedOn" | "reportName";
41
+ declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "submittedOn" | "reportName";
42
42
  export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
43
43
  export interface ReimbursementFilters {
44
44
  categories: ReimbursementFilterCategory[];
@@ -64,7 +64,6 @@ exports.toRemiSubTabUnderScoreType = toRemiSubTabUnderScoreType;
64
64
  const ALL_REIMBURSEMENT_SORT_KEYS = [
65
65
  'reportName',
66
66
  'submittedOn',
67
- 'createdBy',
68
67
  'type',
69
68
  'status',
70
69
  'amount',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.81-betaRR0",
3
+ "version": "4.19.81-betaSS2",
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",