@zeniai/client-epic-state 5.1.85-betaRD3 → 5.1.86

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 (154) hide show
  1. package/lib/entity/aiCfo/aiCfoState.d.ts +2 -2
  2. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
  3. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +2 -6
  4. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +0 -2
  5. package/lib/entity/jeSchedules/jeScheduleHelper.js +0 -7
  6. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +1 -34
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.js +0 -68
  8. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +2 -4
  9. package/lib/entity/jeSchedules/jeSchedulesReducer.js +2 -24
  10. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -10
  11. package/lib/entity/jeSchedules/jeSchedulesSelector.js +3 -28
  12. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +1 -41
  13. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -12
  14. package/lib/entity/jeSchedules/jeSchedulesTypes.js +1 -40
  15. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  16. package/lib/entity/snackbar/snackbarTypes.js +0 -29
  17. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +0 -2
  18. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
  19. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +0 -2
  20. package/lib/epic.d.ts +1 -5
  21. package/lib/epic.js +1 -5
  22. package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +1 -4
  23. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +0 -6
  24. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +1 -68
  25. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +2 -24
  26. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -26
  27. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +0 -34
  28. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -29
  29. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +0 -2
  30. package/lib/esm/epic.js +1 -5
  31. package/lib/esm/index.js +5 -11
  32. package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +1 -4
  33. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
  34. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +3 -34
  35. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +28 -163
  36. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +22 -260
  37. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +6 -5
  38. package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +4 -24
  39. package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +4 -24
  40. package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +10 -37
  41. package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +9 -33
  42. package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +9 -35
  43. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +1 -5
  44. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +5 -32
  45. package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +3 -23
  46. package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +4 -24
  47. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +4 -24
  48. package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +3 -20
  49. package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +17 -60
  50. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -30
  51. package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +29 -4
  52. package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +10 -29
  53. package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +5 -28
  54. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +4 -24
  55. package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +14 -22
  56. package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +7 -46
  57. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +8 -26
  58. package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
  59. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +1 -4
  60. package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +9 -41
  61. package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +1 -4
  62. package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +1 -4
  63. package/lib/index.d.ts +13 -18
  64. package/lib/index.js +50 -76
  65. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
  66. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +2 -5
  67. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +3 -6
  68. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +2 -2
  69. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +1 -32
  70. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  71. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -8
  72. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +10 -45
  73. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +28 -164
  74. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  75. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  76. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +8 -34
  77. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +1 -10
  78. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +21 -266
  79. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  80. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -59
  81. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -8
  82. package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +1 -2
  83. package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +3 -23
  84. package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +1 -2
  85. package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +3 -23
  86. package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +8 -22
  87. package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +10 -37
  88. package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +1 -2
  89. package/lib/view/invoicing/discountAction/discountActionEpic.js +8 -32
  90. package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +1 -2
  91. package/lib/view/invoicing/dunningAction/dunningActionEpic.js +8 -34
  92. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +1 -3
  93. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +1 -5
  94. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +1 -2
  95. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +4 -31
  96. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +1 -2
  97. package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +2 -22
  98. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +1 -2
  99. package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +3 -23
  100. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +1 -2
  101. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +3 -23
  102. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +1 -2
  103. package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +2 -19
  104. package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +1 -2
  105. package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +16 -59
  106. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +0 -13
  107. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
  108. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +0 -30
  109. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +31 -11
  110. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +29 -4
  111. package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +0 -15
  112. package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +1 -2
  113. package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +9 -28
  114. package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +4 -27
  115. package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +1 -2
  116. package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +3 -23
  117. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +7 -24
  118. package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +16 -23
  119. package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +1 -2
  120. package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +6 -45
  121. package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +1 -2
  122. package/lib/view/invoicing/settingsView/settingsViewEpics.js +7 -25
  123. package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +1 -10
  124. package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
  125. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +2 -4
  126. package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -4
  127. package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +1 -2
  128. package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +8 -40
  129. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
  130. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +2 -5
  131. package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
  132. package/lib/view/vendorTabView/vendorTabViewReducer.js +2 -5
  133. package/package.json +1 -1
  134. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -21
  135. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -110
  136. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -73
  137. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -22
  138. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -140
  139. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -1
  140. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -70
  141. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +0 -8
  142. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +0 -25
  143. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +0 -45
  144. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +0 -114
  145. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +0 -8
  146. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +0 -77
  147. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +0 -6
  148. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +0 -26
  149. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +0 -36
  150. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +0 -145
  151. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +0 -25
  152. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +0 -2
  153. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +0 -10
  154. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +0 -75
@@ -140,9 +140,9 @@ export interface AiCfoVisualization {
140
140
  data: TableVisualization | ChartVisualization | InteractiveFormVisualization;
141
141
  type: AiCfoVisualizationType;
142
142
  }
143
- export declare const toMessageSender: (v: string) => "agent" | "user";
143
+ export declare const toMessageSender: (v: string) => "user" | "agent";
144
144
  export declare const toMessageType: (v: string) => "plain_text" | "json";
145
- export declare const toMessageSenderStrict: (v: string) => "agent" | "user" | undefined;
145
+ export declare const toMessageSenderStrict: (v: string) => "user" | "agent" | undefined;
146
146
  export declare const toMessageTypeStrict: (v: string) => "plain_text" | "json" | undefined;
147
147
  export type MessageSender = ReturnType<typeof toMessageSender>;
148
148
  export type MessageType = ReturnType<typeof toMessageType>;
@@ -1,7 +1,7 @@
1
1
  import { CustomerSatisfactionPayload } from './customerSatisfactionPayload';
2
2
  import { CustomerSatisfactionState } from './customerSatisfactionState';
3
3
  export declare const initialState: CustomerSatisfactionState;
4
- export declare const clearAllCustomerSatisfaction: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"customerSatisfaction/clearAllCustomerSatisfaction">, updateCustomerSatisfaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
4
+ export declare const updateCustomerSatisfaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
5
5
  payload: CustomerSatisfactionPayload[];
6
6
  }, "customerSatisfaction/updateCustomerSatisfaction">;
7
7
  declare const _default: import("redux").Reducer<CustomerSatisfactionState>;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.updateCustomerSatisfaction = exports.clearAllCustomerSatisfaction = exports.initialState = void 0;
3
+ exports.updateCustomerSatisfaction = exports.initialState = void 0;
5
4
  const toolkit_1 = require("@reduxjs/toolkit");
6
5
  const rootActions_1 = require("../../rootActions");
7
6
  const customerSatisfactionReducerHelpers_1 = require("./customerSatisfactionReducerHelpers");
@@ -19,13 +18,10 @@ const customerSatisfaction = (0, toolkit_1.createSlice)({
19
18
  draft.customerSatisfactionByCompanyId[newRecord.companyId] = newRecord;
20
19
  });
21
20
  },
22
- clearAllCustomerSatisfaction() {
23
- return exports.initialState;
24
- },
25
21
  },
26
22
  extraReducers: (builder) => {
27
23
  builder.addCase(rootActions_1.clearAll, () => exports.initialState);
28
24
  },
29
25
  });
30
- _a = customerSatisfaction.actions, exports.clearAllCustomerSatisfaction = _a.clearAllCustomerSatisfaction, exports.updateCustomerSatisfaction = _a.updateCustomerSatisfaction;
26
+ exports.updateCustomerSatisfaction = customerSatisfaction.actions.updateCustomerSatisfaction;
31
27
  exports.default = customerSatisfaction.reducer;
@@ -1,4 +1,2 @@
1
- import { ID } from '../../commonStateTypes/common';
2
1
  import { JEAccruedScheduledTransactionPayload } from './jeSchedulesPayload';
3
2
  export declare function generateJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): `${string}_${string}`;
4
- export declare function generateJEOneTimeAccrualKey(accrualId: ID): `${string}_one_time_accrual`;
@@ -1,13 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateJEScheduleKey = generateJEScheduleKey;
4
- exports.generateJEOneTimeAccrualKey = generateJEOneTimeAccrualKey;
5
4
  function generateJEScheduleKey(payload) {
6
5
  return `${payload.je_schedule_id}_${payload.je_schedule_type}`;
7
6
  }
8
- // Suffixed rather than using the bare Mongo _id so the key is a distinct type from
9
- // JEScheduleKey / JEScheduleTransactionKey and the three cannot be passed interchangeably.
10
- // The unsuffixed id stays on the entity as `accrualId` for callers that need it.
11
- function generateJEOneTimeAccrualKey(accrualId) {
12
- return `${accrualId}_one_time_accrual`;
13
- }
@@ -7,7 +7,7 @@ import { TransactionIDPayload } from '../transaction/payloadTypes/transactionIDP
7
7
  import { TransactionCategory } from '../transaction/stateTypes/transactionType';
8
8
  import { UserPayload } from '../user/userPayload';
9
9
  import { VendorPayload } from '../vendor/vendorPayload';
10
- import { JEAccruedScheduledTransactionState, JEOneTimeAccrualState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
10
+ import { JEAccruedScheduledTransactionState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState';
11
11
  import { JEScheduleKey, JEScheduleTransactionKey } from './jeSchedulesTypes';
12
12
  export interface JEScheduleOtherAttributesPayload {
13
13
  asset_id?: string | null;
@@ -72,8 +72,6 @@ export interface JEScheduledTransactionPayload {
72
72
  updated_by: UserPayload;
73
73
  vendor: VendorPayload;
74
74
  ai_summaries?: JEScheduleAISummariesPayload;
75
- confidence_score?: number | null;
76
- create_time?: string | null;
77
75
  created_by?: UserPayload;
78
76
  end_date?: string | null;
79
77
  recommendations?: JEScheduleRecommendationsPayload;
@@ -86,36 +84,6 @@ export interface JEAccruedScheduledTransactionPayload extends Omit<JEScheduledTr
86
84
  memo: string;
87
85
  recurring_amount: number;
88
86
  }
89
- export interface JEOneTimeAccrualPayload {
90
- _id: ID;
91
- estimated_amount: number;
92
- origin: string;
93
- service_month: string;
94
- status: string;
95
- vendor_id: ID;
96
- vendor_name: string;
97
- actual_post_date?: string | null;
98
- actual_reversal_post_date?: string | null;
99
- automation_tier?: string | null;
100
- created_by_user?: UserPayload | null;
101
- currency?: string | null;
102
- expected_reversal_date?: string | null;
103
- je_credit_account_id?: ID | null;
104
- je_credit_account_name?: string | null;
105
- je_credit_accounting_class_id?: ID | null;
106
- je_credit_accounting_class_name?: string | null;
107
- je_debit_account_id?: ID | null;
108
- je_debit_account_name?: string | null;
109
- je_debit_accounting_class_id?: ID | null;
110
- je_debit_accounting_class_name?: string | null;
111
- memo?: string | null;
112
- posting_date?: string | null;
113
- reversal_policy?: string | null;
114
- reversal_transaction_id?: ID | null;
115
- reversal_trigger?: string | null;
116
- transaction_id?: ID | null;
117
- transaction_integration_id?: ID | null;
118
- }
119
87
  export interface ScheduledJournalEntryPayload {
120
88
  actual_post_date: string | null;
121
89
  create_time: string | null;
@@ -146,4 +114,3 @@ export declare function getJEScheduleTransactionDetailKeyPayload(payload: Schedu
146
114
  export declare function getJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): JEScheduleKey;
147
115
  export declare function toJEScheduledTransaction(payload: JEScheduledTransactionPayload): JEScheduledTransactionState;
148
116
  export declare function toJEAccruedScheduledTransaction(payload: JEAccruedScheduledTransactionPayload): JEAccruedScheduledTransactionState;
149
- export declare function toJEOneTimeAccrual(payload: JEOneTimeAccrualPayload): JEOneTimeAccrualState;
@@ -8,15 +8,12 @@ exports.getJEScheduleTransactionDetailKeyPayload = getJEScheduleTransactionDetai
8
8
  exports.getJEScheduleKey = getJEScheduleKey;
9
9
  exports.toJEScheduledTransaction = toJEScheduledTransaction;
10
10
  exports.toJEAccruedScheduledTransaction = toJEAccruedScheduledTransaction;
11
- exports.toJEOneTimeAccrual = toJEOneTimeAccrual;
12
11
  const amount_1 = require("../../commonStateTypes/amount");
13
12
  const timePeriod_1 = require("../../commonStateTypes/timePeriod");
14
13
  const zeniDayJS_1 = require("../../zeniDayJS");
15
- const zeniUrl_1 = require("../../zeniUrl");
16
14
  const transactionIDPayload_1 = require("../transaction/payloadTypes/transactionIDPayload");
17
15
  const jeScheduleHelper_1 = require("./jeScheduleHelper");
18
16
  const jeSchedulesTypes_1 = require("./jeSchedulesTypes");
19
- const USD_CURRENCY_CODE = 'USD';
20
17
  function toScheduledJournalEntryState(payload, currency_code, currency_symbol) {
21
18
  return {
22
19
  status: {
@@ -264,7 +261,6 @@ function toJEScheduledTransaction(payload) {
264
261
  updatedByUserID: payload.updated_by.user_id,
265
262
  balanceAsOfToday: payload.balance ?? undefined,
266
263
  updatedAt: payload.updated_at != null ? (0, zeniDayJS_1.date)(payload.updated_at) : undefined,
267
- createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
268
264
  jeCredit: {
269
265
  accountId: payload.je_credit_account_id ?? undefined,
270
266
  accountingClassId: payload.je_credit_accounting_class_id ?? undefined,
@@ -289,7 +285,6 @@ function toJEScheduledTransaction(payload) {
289
285
  : {},
290
286
  scheduledJournalEntry: [],
291
287
  aiSummaries: toJEScheduleAISummaries(payload.ai_summaries),
292
- confidenceScore: payload.confidence_score ?? undefined,
293
288
  createdByUserID: payload.created_by?.user_id ?? undefined,
294
289
  recommendations: toJEScheduleRecommendations(payload.recommendations),
295
290
  };
@@ -347,66 +342,3 @@ function toJEAccruedScheduledTransaction(payload) {
347
342
  jeScheduleType: (0, jeSchedulesTypes_1.toScheduleTypesTypeStrict)(payload.je_schedule_type),
348
343
  };
349
344
  }
350
- function toJEOneTimeAccrual(payload) {
351
- return {
352
- accrualId: payload._id,
353
- vendorId: payload.vendor_id,
354
- vendorName: payload.vendor_name,
355
- serviceMonth: payload.service_month,
356
- accrualStatus: (0, jeSchedulesTypes_1.toOneTimeAccrualStatusCodeType)(payload.status),
357
- origin: (0, jeSchedulesTypes_1.toOneTimeAccrualOriginType)(payload.origin),
358
- automationTier: payload.automation_tier != null
359
- ? (0, jeSchedulesTypes_1.toOneTimeAccrualAutomationTierType)(payload.automation_tier)
360
- : undefined,
361
- estimatedAmount: toOneTimeAccrualAmount(payload.estimated_amount, payload.currency),
362
- memo: payload.memo ?? '',
363
- // Exclusive by contract: a scheduled row reverses on expectedReversalDate and bills never
364
- // drive it, so the two never need reconciling. Defaulting to on_bill_match matches the
365
- // create path's default when the field is absent on an older document.
366
- reversalPolicy: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalPolicyType)(payload.reversal_policy ?? 'on_bill_match'),
367
- reversalTrigger: (0, jeSchedulesTypes_1.toOneTimeAccrualReversalTriggerType)(payload.reversal_trigger ?? undefined),
368
- expectedReversalDate: payload.expected_reversal_date != null
369
- ? (0, zeniDayJS_1.date)(payload.expected_reversal_date)
370
- : undefined,
371
- postingDate: payload.posting_date != null ? (0, zeniDayJS_1.date)(payload.posting_date) : undefined,
372
- actualPostDate: payload.actual_post_date != null
373
- ? (0, zeniDayJS_1.date)(payload.actual_post_date)
374
- : undefined,
375
- actualReversalPostDate: payload.actual_reversal_post_date != null
376
- ? (0, zeniDayJS_1.date)(payload.actual_reversal_post_date)
377
- : undefined,
378
- jeDebitAccountId: payload.je_debit_account_id ?? undefined,
379
- jeDebitAccountName: payload.je_debit_account_name ?? undefined,
380
- jeDebitAccountingClassId: payload.je_debit_accounting_class_id ?? undefined,
381
- jeDebitAccountingClassName: payload.je_debit_accounting_class_name ?? undefined,
382
- jeCreditAccountId: payload.je_credit_account_id ?? undefined,
383
- jeCreditAccountName: payload.je_credit_account_name ?? undefined,
384
- jeCreditAccountingClassId: payload.je_credit_accounting_class_id ?? undefined,
385
- jeCreditAccountingClassName: payload.je_credit_accounting_class_name ?? undefined,
386
- transactionId: payload.transaction_id ?? undefined,
387
- transactionIntegrationId: payload.transaction_integration_id ?? undefined,
388
- reversalTransactionId: payload.reversal_transaction_id ?? undefined,
389
- createdBy: toJEOneTimeAccrualCreator(payload.created_by_user),
390
- };
391
- }
392
- // The accrual wire format carries a currency CODE but no symbol, so the symbol has to be derived.
393
- // Only USD has a known glyph today (the create path is USD-only); anything else falls back to the
394
- // code, which reads correctly as "EUR 1,200" rather than silently rendering a wrong "$".
395
- function toOneTimeAccrualAmount(amount, currencyCode) {
396
- const code = currencyCode ?? USD_CURRENCY_CODE;
397
- return (0, amount_1.toAmount)(amount, code, code === USD_CURRENCY_CODE ? '$' : code);
398
- }
399
- function toJEOneTimeAccrualCreator(payload) {
400
- if (payload == null) {
401
- return undefined;
402
- }
403
- return {
404
- userId: payload.user_id,
405
- email: payload.email ?? undefined,
406
- firstName: payload.first_name ?? undefined,
407
- lastName: payload.last_name ?? undefined,
408
- photo: payload.photo?.original != null
409
- ? (0, zeniUrl_1.toZeniUrl)(payload.photo.original)
410
- : undefined,
411
- };
412
- }
@@ -1,5 +1,5 @@
1
1
  import { UpdateType } from '../../commonStateTypes/common';
2
- import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from './jeSchedulesPayload';
2
+ import { JEAccruedScheduledTransactionPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from './jeSchedulesPayload';
3
3
  import { JESchedulesState } from './jeSchedulesState';
4
4
  export declare const initialState: JESchedulesState;
5
5
  export declare const updateJESchedules: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeSchedulesTransactionsPayload: JEScheduledTransactionPayload[]], {
@@ -22,8 +22,6 @@ export declare const updateJESchedules: import("@reduxjs/toolkit").ActionCreator
22
22
  jeScheduleTransactionKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
23
23
  }, "jeSchedules/deleteJESchedulesDetails", never, never>, deleteAccruedJESchedulesDetails: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[JEScheduleKey: `${string}_${string}`], {
24
24
  JEScheduleKey: `${string}_${string}`;
25
- }, "jeSchedules/deleteAccruedJESchedulesDetails", never, never>, clearAllAccruedJESchedules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllAccruedJESchedules">, clearAllJEScheduleTransactions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllJEScheduleTransactions">, updateJEOneTimeAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeOneTimeAccrualsPayload: JEOneTimeAccrualPayload[]], {
26
- jeOneTimeAccrualsPayload: JEOneTimeAccrualPayload[];
27
- }, "jeSchedules/updateJEOneTimeAccruals", never, never>;
25
+ }, "jeSchedules/deleteAccruedJESchedulesDetails", never, never>, clearAllAccruedJESchedules: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllAccruedJESchedules">, clearAllJEScheduleTransactions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"jeSchedules/clearAllJEScheduleTransactions">;
28
26
  declare const _default: import("redux").Reducer<JESchedulesState>;
29
27
  export default _default;
@@ -4,16 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.updateJEOneTimeAccruals = exports.clearAllJEScheduleTransactions = exports.clearAllAccruedJESchedules = exports.deleteAccruedJESchedulesDetails = exports.deleteJESchedulesDetails = exports.updateAccruedJESchedulesDetails = exports.updateJESchedulesDetails = exports.updateAccruedJEScheduledTransaction = exports.updateJEScheduledTransaction = exports.updateAccruedJESchedules = exports.updateJESchedules = exports.initialState = void 0;
7
+ exports.clearAllJEScheduleTransactions = exports.clearAllAccruedJESchedules = exports.deleteAccruedJESchedulesDetails = exports.deleteJESchedulesDetails = exports.updateAccruedJESchedulesDetails = exports.updateJESchedulesDetails = exports.updateAccruedJEScheduledTransaction = exports.updateJEScheduledTransaction = exports.updateAccruedJESchedules = exports.updateJESchedules = exports.initialState = void 0;
8
8
  const toolkit_1 = require("@reduxjs/toolkit");
9
9
  const assignWith_1 = __importDefault(require("lodash/assignWith"));
10
- const jeScheduleHelper_1 = require("./jeScheduleHelper");
11
10
  const rootActions_1 = require("../../rootActions");
12
11
  const jeSchedulesPayload_1 = require("./jeSchedulesPayload");
13
12
  exports.initialState = {
14
13
  schedulesByTransactionKey: {},
15
14
  schedulesByAccruedJEScheduleKey: {},
16
- oneTimeAccrualsByKey: {},
17
15
  };
18
16
  const jeSchedules = (0, toolkit_1.createSlice)({
19
17
  name: 'jeSchedules',
@@ -118,25 +116,6 @@ const jeSchedules = (0, toolkit_1.createSlice)({
118
116
  delete draft.schedulesByAccruedJEScheduleKey[JEScheduleKey];
119
117
  },
120
118
  },
121
- // Writes directly, unlike updateAccruedJESchedules / updateJESchedules, which are no-op
122
- // actions whose only job is to trigger the entity fan-out epic that fetches vendors,
123
- // accounts, classes and users. An accrual denormalizes all of those as names on the document,
124
- // so there is nothing to fan out to.
125
- updateJEOneTimeAccruals: {
126
- prepare(jeOneTimeAccrualsPayload) {
127
- return {
128
- payload: {
129
- jeOneTimeAccrualsPayload,
130
- },
131
- };
132
- },
133
- reducer(draft, action) {
134
- action.payload.jeOneTimeAccrualsPayload.forEach((accrualPayload) => {
135
- const accrual = (0, jeSchedulesPayload_1.toJEOneTimeAccrual)(accrualPayload);
136
- draft.oneTimeAccrualsByKey[(0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual.accrualId)] = accrual;
137
- });
138
- },
139
- },
140
119
  clearAllJEScheduleTransactions(draft) {
141
120
  draft.schedulesByTransactionKey = {};
142
121
  },
@@ -148,11 +127,10 @@ const jeSchedules = (0, toolkit_1.createSlice)({
148
127
  builder.addCase(rootActions_1.clearAll, (draft) => {
149
128
  draft.schedulesByAccruedJEScheduleKey = {};
150
129
  draft.schedulesByTransactionKey = {};
151
- draft.oneTimeAccrualsByKey = {};
152
130
  });
153
131
  },
154
132
  });
155
- _a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateAccruedJESchedules = _a.updateAccruedJESchedules, exports.updateJEScheduledTransaction = _a.updateJEScheduledTransaction, exports.updateAccruedJEScheduledTransaction = _a.updateAccruedJEScheduledTransaction, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.updateAccruedJESchedulesDetails = _a.updateAccruedJESchedulesDetails, exports.deleteJESchedulesDetails = _a.deleteJESchedulesDetails, exports.deleteAccruedJESchedulesDetails = _a.deleteAccruedJESchedulesDetails, exports.clearAllAccruedJESchedules = _a.clearAllAccruedJESchedules, exports.clearAllJEScheduleTransactions = _a.clearAllJEScheduleTransactions, exports.updateJEOneTimeAccruals = _a.updateJEOneTimeAccruals;
133
+ _a = jeSchedules.actions, exports.updateJESchedules = _a.updateJESchedules, exports.updateAccruedJESchedules = _a.updateAccruedJESchedules, exports.updateJEScheduledTransaction = _a.updateJEScheduledTransaction, exports.updateAccruedJEScheduledTransaction = _a.updateAccruedJEScheduledTransaction, exports.updateJESchedulesDetails = _a.updateJESchedulesDetails, exports.updateAccruedJESchedulesDetails = _a.updateAccruedJESchedulesDetails, exports.deleteJESchedulesDetails = _a.deleteJESchedulesDetails, exports.deleteAccruedJESchedulesDetails = _a.deleteAccruedJESchedulesDetails, exports.clearAllAccruedJESchedules = _a.clearAllAccruedJESchedules, exports.clearAllJEScheduleTransactions = _a.clearAllJEScheduleTransactions;
156
134
  exports.default = jeSchedules.reducer;
157
135
  /**
158
136
  * Helper functions
@@ -9,8 +9,8 @@ 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 { JEOneTimeAccrualState, JEScheduleAISummaries, JEScheduleOtherAttributes, JEScheduleRecommendations, JESchedulesState, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
13
- import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleTypes } from './jeSchedulesTypes';
12
+ import { JEScheduleAISummaries, JEScheduleOtherAttributes, JEScheduleRecommendations, ScheduleJournalStatusCode, ScheduleStatus } from './jeSchedulesState';
13
+ import { JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleTypes } from './jeSchedulesTypes';
14
14
  export interface ScheduledJournalEntry {
15
15
  error: JournalEntryErrorCodeType[];
16
16
  expectedPostDate: ZeniDate;
@@ -55,17 +55,13 @@ export interface JEScheduledTransaction {
55
55
  accountingClass?: Class;
56
56
  };
57
57
  jeScheduleTransactionKey: JEScheduleTransactionKey;
58
- lifecycleTotal: number;
59
58
  otherAttributes: JEScheduleOtherAttributes;
60
- postedCount: number;
61
59
  scheduledJournalEntry: ScheduledJournalEntry[];
62
60
  status: ScheduleStatus;
63
61
  vendor: Vendor;
64
62
  aiSummaries?: JEScheduleAISummaries;
65
63
  balanceAsOfToday?: Amount;
66
- confidenceScore?: number;
67
64
  createdByUser?: User;
68
- createTime?: ZeniDate;
69
65
  dayOfPostingDate?: ScheduleDaysOfMonth;
70
66
  endDate?: ZeniDate;
71
67
  jeScheduleId?: ID;
@@ -77,9 +73,5 @@ export interface JEScheduledTransaction {
77
73
  updatedAt?: ZeniDate;
78
74
  updatedByUser?: User;
79
75
  }
80
- export interface JEOneTimeAccrual extends JEOneTimeAccrualState {
81
- jeOneTimeAccrualKey: JEOneTimeAccrualKey;
82
- }
83
- export declare const getJEOneTimeAccrualByKey: (jeOneTimeAccrualKey: JEOneTimeAccrualKey, jeSchedulesState: JESchedulesState) => JEOneTimeAccrual | undefined;
84
76
  export declare const getJEAccruedScheduleByJEScheduleKey: (JEScheduleKey: JEScheduleKey, state: RootState) => JEAccruedSchedule | undefined;
85
77
  export declare const getJEScheduledTransactionByJEScheduleTransactionKey: (jeScheduleTransactionKey: JEScheduleTransactionKey, state: RootState) => JEScheduledTransaction;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getJEScheduledTransactionByJEScheduleTransactionKey = exports.getJEAccruedScheduleByJEScheduleKey = exports.getJEOneTimeAccrualByKey = void 0;
6
+ exports.getJEScheduledTransactionByJEScheduleTransactionKey = exports.getJEAccruedScheduleByJEScheduleKey = void 0;
7
7
  const get_1 = __importDefault(require("lodash/get"));
8
8
  const amount_1 = require("../../commonStateTypes/amount");
9
9
  const accountSelector_1 = require("../account/accountSelector");
@@ -11,27 +11,13 @@ const classSelector_1 = require("../class/classSelector");
11
11
  const transactionSelector_1 = require("../transaction/transactionSelector");
12
12
  const userSelector_1 = require("../user/userSelector");
13
13
  const vendorSelector_1 = require("../vendor/vendorSelector");
14
- // Takes the slice, not RootState: an accrual denormalizes its vendor, account and class names, so
15
- // unlike getJEAccruedScheduleByJEScheduleKey this joins nothing.
16
- //
17
- // Spreads the stored entity rather than rebuilding it field by field. That is deliberate — the
18
- // accrued joiner listed every field explicitly and silently dropped jeScheduleType, which made a
19
- // whole tab render empty while its reducer test still passed. A spread cannot lose a field.
20
- const getJEOneTimeAccrualByKey = (jeOneTimeAccrualKey, jeSchedulesState) => {
21
- const accrual = (0, get_1.default)(jeSchedulesState.oneTimeAccrualsByKey, jeOneTimeAccrualKey);
22
- if (accrual == null) {
23
- return undefined;
24
- }
25
- return { ...accrual, jeOneTimeAccrualKey };
26
- };
27
- exports.getJEOneTimeAccrualByKey = getJEOneTimeAccrualByKey;
28
14
  const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
29
15
  const { jeSchedulesState, vendorState, accountState, userState, classState } = state;
30
16
  const JEAccruedScheduleState = (0, get_1.default)(jeSchedulesState.schedulesByAccruedJEScheduleKey, JEScheduleKey);
31
17
  if (JEAccruedScheduleState == null) {
32
18
  return undefined;
33
19
  }
34
- const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, memo, recurringAmount, createTime, otherAttributes, jeScheduleType, } = JEAccruedScheduleState;
20
+ const { period, updatedByUserID: updatedBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, memo, recurringAmount, createTime, otherAttributes, } = JEAccruedScheduleState;
35
21
  const vendorDetails = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
36
22
  if (vendorDetails == null) {
37
23
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
@@ -55,8 +41,6 @@ const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
55
41
  reportId: 'class_list',
56
42
  })
57
43
  : undefined;
58
- const postedCount = scheduledJournalEntry.filter((sje) => sje.status.code === 'posted' || sje.status.code === 'recorded').length;
59
- const lifecycleTotal = period ?? scheduledJournalEntry.length;
60
44
  return {
61
45
  jeScheduleId,
62
46
  otherAttributes,
@@ -65,8 +49,6 @@ const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
65
49
  updatedAt,
66
50
  currencyCode,
67
51
  currencySymbol,
68
- lifecycleTotal,
69
- postedCount,
70
52
  jeCredit: {
71
53
  accountingClass: classCredit,
72
54
  account: accountCredit,
@@ -84,7 +66,6 @@ const getJEAccruedScheduleByJEScheduleKey = (JEScheduleKey, state) => {
84
66
  memo,
85
67
  createTime,
86
68
  recurringAmount,
87
- jeScheduleType,
88
69
  jeAccruedScheduleKey: JEScheduleKey,
89
70
  balanceAsOfToday: balanceAsOfToday != null
90
71
  ? (0, amount_1.toAmount)(balanceAsOfToday, currencyCode, currencySymbol)
@@ -96,7 +77,7 @@ exports.getJEAccruedScheduleByJEScheduleKey = getJEAccruedScheduleByJEScheduleKe
96
77
  const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransactionKey, state) => {
97
78
  const { jeSchedulesState, vendorState, accountState, userState, classState, transactionState, } = state;
98
79
  const jeScheduleTransactionState = (0, get_1.default)(jeSchedulesState.schedulesByTransactionKey, jeScheduleTransactionKey);
99
- const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, createTime, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, confidenceScore, recommendations, } = jeScheduleTransactionState;
80
+ const { period, updatedByUserID: updatedBy, createdByUserID: createdBy, vendorId, jeCredit, jeDebit, currencyCode, currencySymbol, balanceAsOfToday, baseTransaction, startDate, endDate, status, updatedAt, jeScheduleId, scheduledJournalEntry, dayOfPostingDate: postingDate, lastDayOfMonth, otherAttributes, jeScheduleType, aiSummaries, recommendations, } = jeScheduleTransactionState;
100
81
  const vendorDetails = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorId);
101
82
  if (vendorDetails == null) {
102
83
  throw new Error(`Vendor with ${vendorId} doesn't exist`);
@@ -125,8 +106,6 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
125
106
  reportId: 'class_list',
126
107
  })
127
108
  : undefined;
128
- const postedCount = scheduledJournalEntry.filter((sje) => sje.status.code === 'posted' || sje.status.code === 'recorded').length;
129
- const lifecycleTotal = period ?? scheduledJournalEntry.length;
130
109
  return {
131
110
  jeScheduleId,
132
111
  jeScheduleType,
@@ -135,8 +114,6 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
135
114
  updatedByUser: userDetails,
136
115
  updatedAt: updatedAt,
137
116
  period,
138
- lifecycleTotal,
139
- postedCount,
140
117
  balanceAsOfToday: balanceAsOfToday != null
141
118
  ? (0, amount_1.toAmount)(balanceAsOfToday, currencyCode, currencySymbol)
142
119
  : undefined,
@@ -159,9 +136,7 @@ const getJEScheduledTransactionByJEScheduleTransactionKey = (jeScheduleTransacti
159
136
  },
160
137
  scheduledJournalEntry,
161
138
  aiSummaries,
162
- confidenceScore,
163
139
  createdByUser: createdByUserDetails,
164
- createTime,
165
140
  recommendations,
166
141
  };
167
142
  };
@@ -2,9 +2,8 @@ import { Amount } from '../../commonStateTypes/amount';
2
2
  import { ID } from '../../commonStateTypes/common';
3
3
  import { ScheduleDaysOfMonth } from '../../commonStateTypes/timePeriod';
4
4
  import { ZeniDate } from '../../zeniDayJS';
5
- import { ZeniUrl as Url } from '../../zeniUrl';
6
5
  import { TransactionID } from '../transaction/stateTypes/transaction';
7
- import { JEOneTimeAccrualKey, JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, OneTimeAccrualAutomationTierType, OneTimeAccrualOriginType, OneTimeAccrualReversalPolicyType, OneTimeAccrualReversalTriggerType, OneTimeAccrualStatusCodeType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes } from './jeSchedulesTypes';
6
+ import { JEScheduleKey, JEScheduleTransactionKey, JournalEntryErrorCodeType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTypes } from './jeSchedulesTypes';
8
7
  export interface ScheduleStatus {
9
8
  code: ScheduleStatusCodeType;
10
9
  label: string;
@@ -95,9 +94,7 @@ export interface JEScheduledTransactionState {
95
94
  vendorId: ID;
96
95
  aiSummaries?: JEScheduleAISummaries;
97
96
  balanceAsOfToday?: number;
98
- confidenceScore?: number;
99
97
  createdByUserID?: ID;
100
- createTime?: ZeniDate;
101
98
  dayOfPostingDate?: ScheduleDaysOfMonth;
102
99
  endDate?: ZeniDate;
103
100
  jeScheduleId?: ID;
@@ -115,44 +112,7 @@ export interface JEAccruedScheduledTransactionState extends Omit<JEScheduledTran
115
112
  memo: string;
116
113
  recurringAmount: Amount;
117
114
  }
118
- export interface JEOneTimeAccrualCreator {
119
- userId: ID;
120
- email?: string;
121
- firstName?: string;
122
- lastName?: string;
123
- photo?: Url;
124
- }
125
- export interface JEOneTimeAccrualState {
126
- accrualId: ID;
127
- accrualStatus: OneTimeAccrualStatusCodeType;
128
- estimatedAmount: Amount;
129
- memo: string;
130
- origin: OneTimeAccrualOriginType;
131
- reversalPolicy: OneTimeAccrualReversalPolicyType;
132
- serviceMonth: string;
133
- vendorId: ID;
134
- vendorName: string;
135
- actualPostDate?: ZeniDate;
136
- actualReversalPostDate?: ZeniDate;
137
- automationTier?: OneTimeAccrualAutomationTierType;
138
- createdBy?: JEOneTimeAccrualCreator;
139
- expectedReversalDate?: ZeniDate;
140
- jeCreditAccountId?: ID;
141
- jeCreditAccountingClassId?: ID;
142
- jeCreditAccountingClassName?: string;
143
- jeCreditAccountName?: string;
144
- jeDebitAccountId?: ID;
145
- jeDebitAccountingClassId?: ID;
146
- jeDebitAccountingClassName?: string;
147
- jeDebitAccountName?: string;
148
- postingDate?: ZeniDate;
149
- reversalTransactionId?: ID;
150
- reversalTrigger?: OneTimeAccrualReversalTriggerType;
151
- transactionId?: ID;
152
- transactionIntegrationId?: ID;
153
- }
154
115
  export interface JESchedulesState {
155
- oneTimeAccrualsByKey: Record<JEOneTimeAccrualKey, JEOneTimeAccrualState>;
156
116
  schedulesByAccruedJEScheduleKey: Record<JEScheduleKey, JEAccruedScheduledTransactionState>;
157
117
  schedulesByTransactionKey: Record<JEScheduleTransactionKey, JEScheduledTransactionState>;
158
118
  }
@@ -1,12 +1,11 @@
1
1
  import { TransactionID } from '../transaction/stateTypes/transaction';
2
- import { generateJEOneTimeAccrualKey, generateJEScheduleKey } from './jeScheduleHelper';
2
+ import { generateJEScheduleKey } from './jeScheduleHelper';
3
3
  export interface ScheduleTransactionID extends TransactionID {
4
4
  lineId: string;
5
5
  }
6
6
  export declare const getJEScheduleTransactionKey: (scheduleTransactionId: ScheduleTransactionID) => `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
7
7
  export type JEScheduleTransactionKey = ReturnType<typeof getJEScheduleTransactionKey>;
8
8
  export type JEScheduleKey = ReturnType<typeof generateJEScheduleKey>;
9
- export type JEOneTimeAccrualKey = ReturnType<typeof generateJEOneTimeAccrualKey>;
10
9
  export declare const ALL_SCHEDULES_TYPES: readonly ["prepaid_expenses", "fixed_assets", "accrued_expenses", "deferred_revenue"];
11
10
  export declare const toScheduleTypesType: (v: string) => "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue";
12
11
  export type ScheduleTypes = ReturnType<typeof toScheduleTypesType>;
@@ -15,15 +14,5 @@ export declare const toScheduleJournalEntryStatusCodeType: (v: string) => "unkno
15
14
  export type ScheduleJournalEntryStatusCodeType = ReturnType<typeof toScheduleJournalEntryStatusCodeType>;
16
15
  export declare const toScheduleStatusCodeType: (v: string) => "draft" | "completed" | "new" | "ongoing" | "marked_as_completed";
17
16
  export type ScheduleStatusCodeType = ReturnType<typeof toScheduleStatusCodeType>;
18
- export declare const toOneTimeAccrualStatusCodeType: (v: string) => "draft" | "posted" | "posting" | "posting_blocked" | "reversing" | "reversed";
19
- export type OneTimeAccrualStatusCodeType = ReturnType<typeof toOneTimeAccrualStatusCodeType>;
20
- export declare const toOneTimeAccrualOriginType: (v: string) => "agent" | "human";
21
- export type OneTimeAccrualOriginType = ReturnType<typeof toOneTimeAccrualOriginType>;
22
- export declare const toOneTimeAccrualAutomationTierType: (v: string) => "draft" | "manual" | "auto";
23
- export type OneTimeAccrualAutomationTierType = ReturnType<typeof toOneTimeAccrualAutomationTierType>;
24
- export declare const toOneTimeAccrualReversalPolicyType: (v: string) => "on_bill_match" | "scheduled_date";
25
- export type OneTimeAccrualReversalPolicyType = ReturnType<typeof toOneTimeAccrualReversalPolicyType>;
26
- export declare const toOneTimeAccrualReversalTriggerType: (v?: string) => "scheduled_date" | "bill_match" | "manual_reverse" | undefined;
27
- export type OneTimeAccrualReversalTriggerType = ReturnType<typeof toOneTimeAccrualReversalTriggerType>;
28
17
  export declare const toJournalEntryErrorCodeType: (v: string) => "vendor_deleted" | "debit_category_deleted" | "credit_category_deleted" | "qbo_error" | "qbo_authorization_error" | "qbo_invalid_company_status_error" | "qbo_book_close_date_error";
29
18
  export type JournalEntryErrorCodeType = ReturnType<typeof toJournalEntryErrorCodeType>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toJournalEntryErrorCodeType = exports.toOneTimeAccrualReversalTriggerType = exports.toOneTimeAccrualReversalPolicyType = exports.toOneTimeAccrualAutomationTierType = exports.toOneTimeAccrualOriginType = exports.toOneTimeAccrualStatusCodeType = exports.toScheduleStatusCodeType = exports.toScheduleJournalEntryStatusCodeType = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = void 0;
3
+ exports.toJournalEntryErrorCodeType = exports.toScheduleStatusCodeType = exports.toScheduleJournalEntryStatusCodeType = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = void 0;
4
4
  const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
5
5
  const getJEScheduleTransactionKey = (scheduleTransactionId) => `${scheduleTransactionId.id}_${scheduleTransactionId.type}_${scheduleTransactionId.lineId}`;
6
6
  exports.getJEScheduleTransactionKey = getJEScheduleTransactionKey;
@@ -32,45 +32,6 @@ const SCHEDULE_STATUS_CODE = [
32
32
  ];
33
33
  const toScheduleStatusCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, SCHEDULE_STATUS_CODE);
34
34
  exports.toScheduleStatusCodeType = toScheduleStatusCodeType;
35
- // One-time accruals come from agent-je's Mongo `accruals` collection, not the JE schedule
36
- // datastore, so they carry their own status vocabulary rather than SCHEDULE_STATUS_CODE.
37
- // `posting` and `reversing` are transient claims held while a JE posts.
38
- const ONE_TIME_ACCRUAL_STATUS_CODE = [
39
- 'draft',
40
- 'posting',
41
- 'posted',
42
- 'posting_blocked',
43
- 'reversing',
44
- 'reversed',
45
- ];
46
- const toOneTimeAccrualStatusCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_STATUS_CODE);
47
- exports.toOneTimeAccrualStatusCodeType = toOneTimeAccrualStatusCodeType;
48
- // Who created the accrual. This — not the creator's email — is the authoritative
49
- // AI-vs-manual signal for the Method column.
50
- const ONE_TIME_ACCRUAL_ORIGIN = ['agent', 'human'];
51
- const toOneTimeAccrualOriginType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_ORIGIN);
52
- exports.toOneTimeAccrualOriginType = toOneTimeAccrualOriginType;
53
- const ONE_TIME_ACCRUAL_AUTOMATION_TIER = ['manual', 'draft', 'auto'];
54
- const toOneTimeAccrualAutomationTierType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_AUTOMATION_TIER);
55
- exports.toOneTimeAccrualAutomationTierType = toOneTimeAccrualAutomationTierType;
56
- // How the accrual is allowed to reverse. The two are exclusive: a scheduled row reverses on
57
- // expectedReversalDate and bills never drive it; an on_bill_match row reverses only when a bill
58
- // is matched, which is why its lifecycle reads "Reverses on match" rather than showing a date.
59
- const ONE_TIME_ACCRUAL_REVERSAL_POLICY = [
60
- 'on_bill_match',
61
- 'scheduled_date',
62
- ];
63
- const toOneTimeAccrualReversalPolicyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ONE_TIME_ACCRUAL_REVERSAL_POLICY);
64
- exports.toOneTimeAccrualReversalPolicyType = toOneTimeAccrualReversalPolicyType;
65
- // What actually caused a reverse. Distinct from a *revert*, which soft-deletes the row and
66
- // never sets this.
67
- const ONE_TIME_ACCRUAL_REVERSAL_TRIGGER = [
68
- 'bill_match',
69
- 'scheduled_date',
70
- 'manual_reverse',
71
- ];
72
- const toOneTimeAccrualReversalTriggerType = (v) => (0, stringToUnion_1.stringToUnionStrict)(v ?? '', ONE_TIME_ACCRUAL_REVERSAL_TRIGGER);
73
- exports.toOneTimeAccrualReversalTriggerType = toOneTimeAccrualReversalTriggerType;
74
35
  const JOURNAL_ENTRY_ERROR_CODE = [
75
36
  'vendor_deleted',
76
37
  'debit_category_deleted',