@zeniai/client-epic-state 5.2.11-beta0ND → 5.2.11-betaAM1

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 (191) hide show
  1. package/lib/entity/invoicing/invoicingCommonPayload.d.ts +29 -27
  2. package/lib/entity/invoicing/invoicingCommonPayload.js +75 -37
  3. package/lib/entity/invoicing/product/productPayload.d.ts +0 -10
  4. package/lib/entity/invoicing/product/productPayload.js +2 -14
  5. package/lib/entity/jeSchedules/jeScheduleHelper.d.ts +1 -0
  6. package/lib/entity/jeSchedules/jeScheduleHelper.js +7 -0
  7. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +86 -1
  8. package/lib/entity/jeSchedules/jeSchedulesPayload.js +172 -0
  9. package/lib/entity/jeSchedules/jeSchedulesReducer.d.ts +4 -2
  10. package/lib/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  11. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +11 -2
  12. package/lib/entity/jeSchedules/jeSchedulesSelector.js +38 -3
  13. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +101 -1
  14. package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +24 -1
  15. package/lib/entity/jeSchedules/jeSchedulesTypes.js +88 -1
  16. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  17. package/lib/entity/snackbar/snackbarTypes.js +3 -0
  18. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +2 -0
  19. package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  20. package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +2 -0
  21. package/lib/epic.d.ts +15 -3
  22. package/lib/epic.js +31 -12
  23. package/lib/esm/entity/invoicing/invoicingCommonPayload.js +73 -33
  24. package/lib/esm/entity/invoicing/product/productPayload.js +2 -14
  25. package/lib/esm/entity/jeSchedules/jeScheduleHelper.js +6 -0
  26. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +172 -1
  27. package/lib/esm/entity/jeSchedules/jeSchedulesReducer.js +30 -2
  28. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +36 -2
  29. package/lib/esm/entity/jeSchedules/jeSchedulesTypes.js +78 -0
  30. package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
  31. package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +2 -0
  32. package/lib/esm/epic.js +27 -8
  33. package/lib/esm/index.js +23 -14
  34. package/lib/esm/reducer.js +3 -0
  35. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +46 -0
  36. package/lib/esm/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +7 -0
  37. package/lib/esm/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +50 -0
  38. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +44 -0
  39. package/lib/esm/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +44 -0
  40. package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
  41. package/lib/esm/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  42. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  43. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +41 -5
  44. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +45 -0
  45. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  46. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +104 -0
  47. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +25 -0
  48. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +136 -0
  49. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +79 -0
  50. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +157 -0
  51. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +111 -0
  52. package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +33 -0
  53. package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  54. package/lib/esm/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +140 -0
  55. package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +35 -0
  56. package/lib/esm/view/expenseAutomationView/payload/jeSchedulesPayload.js +55 -0
  57. package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +260 -0
  58. package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +314 -29
  59. package/lib/esm/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +1 -0
  60. package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +162 -0
  61. package/lib/esm/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  62. package/lib/esm/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +106 -0
  63. package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +297 -22
  64. package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +22 -0
  65. package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -5
  66. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
  67. package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
  68. package/lib/esm/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +0 -40
  69. package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +92 -0
  70. package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -25
  71. package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +0 -41
  72. package/lib/esm/view/recommendation/recommendationReducer.js +1 -16
  73. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  74. package/lib/esm/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  75. package/lib/esm/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  76. package/lib/index.d.ts +29 -22
  77. package/lib/index.js +116 -56
  78. package/lib/reducer.d.ts +1 -0
  79. package/lib/reducer.js +3 -0
  80. package/lib/rootStateTypes.d.ts +2 -0
  81. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
  82. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingEpic.js +50 -0
  83. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
  84. package/lib/view/expenseAutomationView/epics/actualMatching/fetchActualMatchingPageEpic.js +11 -0
  85. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.d.ts +8 -0
  86. package/lib/view/expenseAutomationView/epics/actualMatching/matchAndReverseAccrualsEpic.js +54 -0
  87. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.d.ts +8 -0
  88. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchAccrualsEpic.js +48 -0
  89. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
  90. package/lib/view/expenseAutomationView/epics/actualMatching/searchMatchTransactionsEpic.js +48 -0
  91. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.d.ts +2 -1
  92. package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +30 -10
  93. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.d.ts +2 -1
  94. package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +9 -1
  95. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +9 -1
  96. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.d.ts +3 -2
  97. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +39 -3
  98. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.d.ts +21 -0
  99. package/lib/view/expenseAutomationView/epics/jeSchedule/fetchOneTimeAccrualEpic.js +49 -0
  100. package/lib/view/expenseAutomationView/epics/jeSchedule/ignoreRecommendedJeScheduleEpic.js +14 -2
  101. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.d.ts +9 -0
  102. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/createOneTimeAccrualEpic.js +108 -0
  103. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.d.ts +8 -0
  104. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +29 -0
  105. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.d.ts +9 -0
  106. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/saveNewScheduleEpic.js +140 -0
  107. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.d.ts +8 -0
  108. package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/searchTransactionsForNewScheduleEpic.js +83 -0
  109. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.d.ts +13 -0
  110. package/lib/view/expenseAutomationView/epics/jeSchedule/oneTimeAccrualActionsEpic.js +164 -0
  111. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.d.ts +65 -0
  112. package/lib/view/expenseAutomationView/epics/jeSchedule/revertJeScheduleEpic.js +115 -0
  113. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.d.ts +7 -0
  114. package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +37 -0
  115. package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +22 -7
  116. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.d.ts +36 -0
  117. package/lib/view/expenseAutomationView/helpers/newScheduleLocalDataHelper.js +145 -0
  118. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  119. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +66 -0
  120. package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +40 -0
  121. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +72 -3
  122. package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.js +58 -1
  123. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +53 -0
  124. package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +264 -0
  125. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +91 -12
  126. package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +316 -29
  127. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
  128. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
  129. package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +58 -0
  130. package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +2 -0
  131. package/lib/view/expenseAutomationView/selectorTypes/jeAccountSettingsViewSelectorTypes.d.ts +1 -0
  132. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.d.ts +42 -0
  133. package/lib/view/expenseAutomationView/selectorTypes/jeNewScheduleViewSelectorTypes.js +2 -0
  134. package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +36 -7
  135. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +9 -0
  136. package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +172 -0
  137. package/lib/view/expenseAutomationView/selectors/jeAccountSettingsViewSelector.js +1 -0
  138. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.d.ts +21 -0
  139. package/lib/view/expenseAutomationView/selectors/jeNewScheduleViewSelector.js +112 -0
  140. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.d.ts +34 -0
  141. package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +305 -21
  142. package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +76 -0
  143. package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +27 -0
  144. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +1 -1
  145. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +83 -8
  146. package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +11 -7
  147. package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +2 -2
  148. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.d.ts +1 -12
  149. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +9 -25
  150. package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +1 -6
  151. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.d.ts +1 -10
  152. package/lib/view/invoicing/invoicingQboView/invoicingQboViewSelector.js +1 -43
  153. package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +12 -0
  154. package/lib/view/invoicing/settingsView/settingsViewEpics.js +99 -0
  155. package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +1 -4
  156. package/lib/view/invoicing/settingsView/settingsViewReducer.js +2 -26
  157. package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +0 -35
  158. package/lib/view/invoicing/settingsView/settingsViewSelector.js +1 -43
  159. package/lib/view/invoicing/settingsView/settingsViewState.d.ts +0 -8
  160. package/lib/view/recommendation/recommendationPayload.d.ts +0 -34
  161. package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
  162. package/lib/view/recommendation/recommendationReducer.js +2 -17
  163. package/lib/view/scheduleView/scheduleListView/epics/fetchAccruedScheduleListEpic.js +1 -1
  164. package/lib/view/scheduleView/scheduleListView/epics/fetchDownloadSchedulesEpic.js +7 -2
  165. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.d.ts +4 -2
  166. package/lib/view/scheduleView/scheduleListView/scheduleListReducer.js +5 -3
  167. package/package.json +1 -1
  168. package/lib/esm/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -27
  169. package/lib/esm/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -19
  170. package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -19
  171. package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -39
  172. package/lib/esm/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -25
  173. package/lib/esm/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -48
  174. package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +0 -52
  175. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.d.ts +0 -6
  176. package/lib/view/invoicing/settingsView/epics/connectInvoicingStripeEpic.js +0 -31
  177. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.d.ts +0 -6
  178. package/lib/view/invoicing/settingsView/epics/disconnectInvoicingStripeEpic.js +0 -23
  179. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.d.ts +0 -6
  180. package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +0 -23
  181. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.d.ts +0 -6
  182. package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +0 -43
  183. package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +0 -5
  184. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.d.ts +0 -11
  185. package/lib/view/invoicing/settingsView/epics/submitInvoicingQboSettingsEpic.js +0 -29
  186. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.d.ts +0 -34
  187. package/lib/view/invoicing/settingsView/invoicingQboSettingsFormConfig.js +0 -53
  188. package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
  189. package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -56
  190. /package/lib/esm/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js} +0 -0
  191. /package/lib/view/{invoicing/settingsView/epics/settingsViewActionType.js → expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js} +0 -0
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
39
39
  export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
40
40
  export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
41
41
  export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
42
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
42
+ messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_approval_reorder" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_approval_reorder" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "revert_schedule" | "ignore_accrual" | "revert_accrual" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "accounting_projects_enabled_update" | "accounting_projects_qbo_not_enabled" | "capitalization_threshold_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "confirm_statement_mapping" | "statement_parsing_in_progress" | "statement_parsing_complete" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron" | "create_sub_task" | "qbo_connection_already_linked" | "qbo_connection_failed" | "accounting_projects_qbo_reconnect_failed" | "product_services_update" | "qbo_realm_id_update" | "invoicing_dunning_case_resolved" | "invoicing_dunning_retry" | "invoicing_dunning_cancel" | "invoicing_dunning_settings_save" | "invoicing_qbo_backfill" | "invoicing_qbo_sync_health_retry" | "invoicing_qbo_settings_save" | "invoicing_branding_save" | "invoicing_discount_archive" | "invoicing_discount_unarchive" | "invoicing_discount_delete" | "invoicing_invoice_reminder_sent" | "invoicing_invoice_regenerated" | "invoicing_invoice_voided" | "invoicing_catalog_item_saved" | "invoicing_customer_saved" | "invoicing_subscription_saved" | "invoicing_coupon_saved" | "invoicing_invoice_saved" | "invoicing_credit_note_saved" | "invoicing_payment_recorded" | "invoicing_subscription_activated" | "invoicing_subscription_cancellation_removed" | "invoicing_subscription_cancelled" | "invoicing_subscription_non_renewing" | "invoicing_subscription_paused" | "invoicing_subscription_reactivated" | "invoicing_subscription_resumed" | "invoicing_subscription_term_end_changed";
43
43
  messageText: "notification" | "failed" | "success";
44
44
  type: "error" | "success" | "info";
45
45
  variables: {
@@ -0,0 +1,66 @@
1
+ import { ID } from '../../../commonStateTypes/common';
2
+ import { TimePeriod } from '../../../commonStateTypes/timePeriod';
3
+ import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
4
+ import { ZeniAPIResponse } from '../../../responsePayload';
5
+ import { ActualMatchingTransactionSearchResult, MatchAndReverseResult } from '../types/actualMatchingViewState';
6
+ export declare function toServiceMonthFromPeriod(period: TimePeriod): string;
7
+ export interface ActualMatchingListResponsePayload {
8
+ accruals: JEOneTimeAccrualPayload[];
9
+ total: number;
10
+ limit?: number | null;
11
+ offset?: number | null;
12
+ }
13
+ export type ActualMatchingListResponse = ZeniAPIResponse<ActualMatchingListResponsePayload>;
14
+ export interface ActualMatchingAccrualSearchResponsePayload {
15
+ accruals: JEOneTimeAccrualPayload[];
16
+ total: number;
17
+ limit?: number | null;
18
+ offset?: number | null;
19
+ }
20
+ export type ActualMatchingAccrualSearchResponse = ZeniAPIResponse<ActualMatchingAccrualSearchResponsePayload>;
21
+ export interface MatchTransactionSearchQueryPayload {
22
+ page_size: number;
23
+ search_text: string;
24
+ page_token?: string | null;
25
+ }
26
+ export interface MatchTransactionSearchResultPayload {
27
+ line_id: string;
28
+ total_amount: number;
29
+ transaction_date: string;
30
+ transaction_id: ID;
31
+ transaction_integration_id: string;
32
+ transaction_type: string;
33
+ account_id?: ID | null;
34
+ account_name?: string | null;
35
+ currency_code?: string | null;
36
+ currency_symbol?: string | null;
37
+ transaction_memo?: string | null;
38
+ vendor_id?: ID | null;
39
+ vendor_name?: string | null;
40
+ }
41
+ export interface MatchTransactionSearchResponsePayload {
42
+ transactions: MatchTransactionSearchResultPayload[];
43
+ next_page_token?: string | null;
44
+ }
45
+ export type MatchTransactionSearchResponse = ZeniAPIResponse<MatchTransactionSearchResponsePayload>;
46
+ export declare function toActualMatchingTransactionSearchResult(payload: MatchTransactionSearchResultPayload): ActualMatchingTransactionSearchResult;
47
+ export interface MatchAndReverseRequestPayload {
48
+ accrual_ids: ID[];
49
+ line_id: string;
50
+ transaction_id: ID;
51
+ transaction_integration_id: string;
52
+ transaction_type: string;
53
+ }
54
+ export interface MatchAndReverseResultPayload {
55
+ accrual_id: ID;
56
+ status: string;
57
+ reason?: string | null;
58
+ }
59
+ export interface MatchAndReverseResponsePayload {
60
+ match_batch_id: string;
61
+ results: MatchAndReverseResultPayload[];
62
+ transaction_id: ID;
63
+ transaction_integration_id: string;
64
+ }
65
+ export type MatchAndReverseResponse = ZeniAPIResponse<MatchAndReverseResponsePayload>;
66
+ export declare function toMatchAndReverseResult(payload: MatchAndReverseResultPayload): MatchAndReverseResult;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toServiceMonthFromPeriod = toServiceMonthFromPeriod;
4
+ exports.toActualMatchingTransactionSearchResult = toActualMatchingTransactionSearchResult;
5
+ exports.toMatchAndReverseResult = toMatchAndReverseResult;
6
+ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
+ const actualMatchingViewState_1 = require("../types/actualMatchingViewState");
8
+ function toServiceMonthFromPeriod(period) {
9
+ return (0, timePeriod_1.toString)(period.start).slice(0, 7);
10
+ }
11
+ const DEFAULT_CURRENCY_CODE = 'USD';
12
+ const DEFAULT_CURRENCY_SYMBOL = '$';
13
+ function toActualMatchingTransactionSearchResult(payload) {
14
+ const currencyCode = payload.currency_code ?? DEFAULT_CURRENCY_CODE;
15
+ return {
16
+ transactionId: payload.transaction_id,
17
+ transactionIntegrationId: payload.transaction_integration_id,
18
+ transactionType: payload.transaction_type,
19
+ lineId: payload.line_id,
20
+ vendorId: payload.vendor_id ?? undefined,
21
+ vendorName: payload.vendor_name ?? '',
22
+ amount: payload.total_amount,
23
+ transactionDate: payload.transaction_date,
24
+ accountId: payload.account_id ?? undefined,
25
+ accountName: payload.account_name ?? undefined,
26
+ currencyCode,
27
+ currencySymbol: payload.currency_symbol ??
28
+ (currencyCode === DEFAULT_CURRENCY_CODE
29
+ ? DEFAULT_CURRENCY_SYMBOL
30
+ : currencyCode),
31
+ transactionMemo: payload.transaction_memo ?? undefined,
32
+ };
33
+ }
34
+ function toMatchAndReverseResult(payload) {
35
+ return {
36
+ accrualId: payload.accrual_id,
37
+ status: (0, actualMatchingViewState_1.toMatchAndReverseResultStatus)(payload.status),
38
+ reason: payload.reason ?? undefined,
39
+ };
40
+ }
@@ -1,13 +1,17 @@
1
- import { JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
1
+ import { ID } from '../../../commonStateTypes/common';
2
+ import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload, ScheduledJournalEntryPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
2
3
  import { JEScheduledTransaction } from '../../../entity/jeSchedules/jeSchedulesSelector';
3
- import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
+ import { OneTimeAccrualIgnoreReasonType, OneTimeAccrualRevertReasonType, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
4
5
  import { ZeniAPIResponse } from '../../../responsePayload';
5
6
  import { RootState } from '../../../rootStateTypes';
7
+ import { ZeniDate } from '../../../zeniDayJS';
6
8
  import { JESchedulePayload, SaveJESchedulePayload } from '../../scheduleView/scheduleDetailView/scheduleDetailPayload';
7
- import { JEScheduleLocalData } from '../types/jeSchedulesViewState';
9
+ import { JEScheduleLocalData, NewOneTimeAccrualLocalData } from '../types/jeSchedulesViewState';
8
10
  export interface ExpenseAutomationJESchedulesQueryPayload {
9
11
  end_date: string;
12
+ include_accrued: boolean;
10
13
  start_date: string;
14
+ close_period_start_date?: string;
11
15
  }
12
16
  interface ExpenseAutomationJESchedulesPayload {
13
17
  failed_je_postings: {
@@ -15,8 +19,73 @@ interface ExpenseAutomationJESchedulesPayload {
15
19
  scheduled_journal_entries: ScheduledJournalEntryPayload[];
16
20
  };
17
21
  je_schedules: JEScheduledTransactionPayload[];
22
+ accrued_je_schedules?: {
23
+ je_schedules: JEAccruedScheduledTransactionPayload[];
24
+ scheduled_journal_entries?: ScheduledJournalEntryPayload[];
25
+ };
26
+ one_time_accruals?: JEOneTimeAccrualPayload[];
18
27
  }
19
28
  export type ExpenseAutomationJESchedulesResponse = ZeniAPIResponse<ExpenseAutomationJESchedulesPayload>;
29
+ export interface CreateOneTimeAccrualPayload {
30
+ amount: number;
31
+ je_credit_account_id: ID;
32
+ je_debit_account_id: ID;
33
+ memo: string;
34
+ service_month: string;
35
+ vendor_id: ID;
36
+ vendor_name: string;
37
+ expected_reversal_date?: string;
38
+ je_credit_account_name?: string;
39
+ je_credit_accounting_class_id?: ID;
40
+ je_credit_accounting_class_name?: string;
41
+ je_debit_account_name?: string;
42
+ je_debit_accounting_class_id?: ID;
43
+ je_debit_accounting_class_name?: string;
44
+ reversal_policy?: string;
45
+ reverse_next_month?: boolean;
46
+ }
47
+ export type CreateOneTimeAccrualResponse = ZeniAPIResponse<{
48
+ accrual: JEOneTimeAccrualPayload;
49
+ }>;
50
+ /**
51
+ * Promote body. `vendor_id`, `vendor_name` and `service_month` are deliberately absent: promote
52
+ * treats them as immutable and takes them from the existing draft, so sending them would imply a
53
+ * reassignment the API silently ignores.
54
+ */
55
+ export interface PromoteOneTimeAccrualPayload {
56
+ amount: number;
57
+ je_credit_account_id: ID;
58
+ je_debit_account_id: ID;
59
+ memo: string;
60
+ }
61
+ /**
62
+ * Ignore body. `scope` is deliberately absent — the API returns 400 if it is sent, which is why the
63
+ * design's "Apply to" selector cannot be built yet.
64
+ */
65
+ /**
66
+ * Revert deletes the accrual's journal entry in QBO and soft-deletes the row. `scope` is rejected
67
+ * with a 400, exactly as on ignore.
68
+ */
69
+ export interface RevertOneTimeAccrualPayload {
70
+ reason: OneTimeAccrualRevertReasonType;
71
+ note?: string;
72
+ }
73
+ export interface IgnoreOneTimeAccrualPayload {
74
+ reason: OneTimeAccrualIgnoreReasonType;
75
+ note?: string;
76
+ }
77
+ /**
78
+ * The credit line is the accrued liability, which always sits on the balance sheet — the
79
+ * recurring accrued path resolves the same class the same way (see
80
+ * prepareNewScheduleAccruedDetailPayload). Omitted rather than sent empty when the tenant has
81
+ * no balance_sheet class, since the API treats the field as optional.
82
+ */
83
+ export declare const prepareCreateOneTimeAccrualPayload: (state: RootState, localData: NewOneTimeAccrualLocalData) => CreateOneTimeAccrualPayload;
84
+ /**
85
+ * The API defaults this to the 1st of the month after service_month. We send it explicitly so the
86
+ * date the form promised the user is the date that gets stored.
87
+ */
88
+ export declare const getExpectedReversalDate: (serviceMonth: ZeniDate) => ZeniDate;
20
89
  export interface IgnoreDraftJESchedulePayload {
21
90
  je_schedules: JEScheduledTransactionPayload[];
22
91
  scheduled_journal_entries: SaveJESchedulePayload[];
@@ -1,8 +1,65 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.preparePayloadForRetryPosting = exports.prepareIgnoreSchedulePayload = void 0;
3
+ exports.preparePayloadForRetryPosting = exports.prepareIgnoreSchedulePayload = exports.getExpectedReversalDate = exports.prepareCreateOneTimeAccrualPayload = void 0;
4
4
  const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
5
+ const classListSelector_1 = require("../../classList/classListSelector");
5
6
  const scheduleDetailPayload_1 = require("../../scheduleView/scheduleDetailView/scheduleDetailPayload");
7
+ const BALANCE_SHEET_CLASS_LABEL = 'balance_sheet';
8
+ const SERVICE_MONTH_FORMAT = 'YYYY-MM';
9
+ /**
10
+ * The credit line is the accrued liability, which always sits on the balance sheet — the
11
+ * recurring accrued path resolves the same class the same way (see
12
+ * prepareNewScheduleAccruedDetailPayload). Omitted rather than sent empty when the tenant has
13
+ * no balance_sheet class, since the API treats the field as optional.
14
+ */
15
+ const prepareCreateOneTimeAccrualPayload = (state, localData) => {
16
+ const { classListState, classState } = state;
17
+ const balanceSheetClass = (0, classListSelector_1.getClassList)(classState, classListState).classes.find((accountingClass) => accountingClass.labels?.includes(BALANCE_SHEET_CLASS_LABEL) === true);
18
+ // reverse_next_month alone decides reversal_policy server-side, so reversal_policy is
19
+ // deliberately not sent — the API documents it only as an alternate way to say on_bill_match,
20
+ // and sending both would be two sources of truth for one toggle.
21
+ const reversalFields = localData.reverseNextMonth
22
+ ? {
23
+ reverse_next_month: true,
24
+ expected_reversal_date: (0, exports.getExpectedReversalDate)(localData.serviceMonth).format(timePeriod_1.DEFAULT_DATE_FORMAT),
25
+ }
26
+ : { reverse_next_month: false };
27
+ return {
28
+ vendor_id: localData.vendorId,
29
+ vendor_name: localData.vendorName,
30
+ service_month: localData.serviceMonth.format(SERVICE_MONTH_FORMAT),
31
+ amount: localData.amount,
32
+ memo: localData.memo,
33
+ je_debit_account_id: localData.debitAccountId,
34
+ je_credit_account_id: localData.creditAccountId,
35
+ ...(localData.debitAccountName != null
36
+ ? { je_debit_account_name: localData.debitAccountName }
37
+ : {}),
38
+ ...(localData.creditAccountName != null
39
+ ? { je_credit_account_name: localData.creditAccountName }
40
+ : {}),
41
+ ...(localData.debitClassId != null
42
+ ? { je_debit_accounting_class_id: localData.debitClassId }
43
+ : {}),
44
+ ...(localData.debitClassName != null
45
+ ? { je_debit_accounting_class_name: localData.debitClassName }
46
+ : {}),
47
+ ...(balanceSheetClass != null
48
+ ? {
49
+ je_credit_accounting_class_id: balanceSheetClass.classId,
50
+ je_credit_accounting_class_name: balanceSheetClass.className,
51
+ }
52
+ : {}),
53
+ ...reversalFields,
54
+ };
55
+ };
56
+ exports.prepareCreateOneTimeAccrualPayload = prepareCreateOneTimeAccrualPayload;
57
+ /**
58
+ * The API defaults this to the 1st of the month after service_month. We send it explicitly so the
59
+ * date the form promised the user is the date that gets stored.
60
+ */
61
+ const getExpectedReversalDate = (serviceMonth) => serviceMonth.add(1, 'month').startOf('month');
62
+ exports.getExpectedReversalDate = getExpectedReversalDate;
6
63
  const prepareIgnoreSchedulePayload = (scheduleType, jeScheduleTransaction, state) => {
7
64
  const { vendorState } = state;
8
65
  const { vendor, currencyCode, currencySymbol, baseTransaction, status, balanceAsOfToday, period, startDate, endDate, jeCredit, jeDebit, } = jeScheduleTransaction;
@@ -0,0 +1,53 @@
1
+ import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
2
+ import { JEOneTimeAccrualPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
3
+ import { ZeniAPIStatus } from '../../../responsePayload';
4
+ import { ActualMatchingAccrualSearchState, ActualMatchingMatchModalState, ActualMatchingTransactionSearchResult, ActualMatchingTransactionSearchState, ActualMatchingViewState, ActualMatchingViewUIState, MatchAndReverseAccrualsParams, MatchAndReverseResult } from '../types/actualMatchingViewState';
5
+ export declare const initialTransactionSearchState: ActualMatchingTransactionSearchState;
6
+ export declare const initialAccrualSearchState: ActualMatchingAccrualSearchState;
7
+ export declare const initialMatchModalState: ActualMatchingMatchModalState;
8
+ export declare const initialState: ActualMatchingViewState;
9
+ export declare const clearActualMatchingView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearActualMatchingView">, clearMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/clearMatchNewModal">, closeMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/closeMatchNewModal">, fetchActualMatching: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
10
+ period: TimePeriod;
11
+ refreshViewInBackground: any;
12
+ }, "expenseAutomationActualMatchingView/fetchActualMatching", never, never>, fetchActualMatchingFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
+ refreshViewInBackground: boolean;
14
+ selectedPeriod: MonthYearPeriod;
15
+ status: ZeniAPIStatus;
16
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingFailure">, fetchActualMatchingPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, refreshViewInBackground?: any], {
17
+ period: TimePeriod;
18
+ refreshViewInBackground: any;
19
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingPage", never, never>, fetchActualMatchingSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
20
+ accruals: JEOneTimeAccrualPayload[];
21
+ refreshViewInBackground: boolean;
22
+ selectedPeriod: MonthYearPeriod;
23
+ }, "expenseAutomationActualMatchingView/fetchActualMatchingSuccess">, matchAndReverseAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[params: MatchAndReverseAccrualsParams], MatchAndReverseAccrualsParams, "expenseAutomationActualMatchingView/matchAndReverseAccruals", never, never>, matchAndReverseAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
24
+ status: ZeniAPIStatus;
25
+ }, "expenseAutomationActualMatchingView/matchAndReverseAccrualsFailure">, matchAndReverseAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
26
+ results: MatchAndReverseResult[];
27
+ }, "expenseAutomationActualMatchingView/matchAndReverseAccrualsSuccess">, openMatchNewModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"expenseAutomationActualMatchingView/openMatchNewModal">, searchMatchAccruals: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
28
+ query: string;
29
+ pageToken?: string | null;
30
+ }], {
31
+ query: string;
32
+ pageToken: string | undefined;
33
+ }, "expenseAutomationActualMatchingView/searchMatchAccruals", never, never>, searchMatchAccrualsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
34
+ error: ZeniAPIStatus;
35
+ }, "expenseAutomationActualMatchingView/searchMatchAccrualsFailure">, searchMatchAccrualsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
36
+ append: boolean;
37
+ nextPageToken: string | null;
38
+ results: JEOneTimeAccrualPayload[];
39
+ }, "expenseAutomationActualMatchingView/searchMatchAccrualsSuccess">, searchMatchTransactions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
40
+ query: string;
41
+ pageToken?: string | null;
42
+ }], {
43
+ query: string;
44
+ pageToken: string | undefined;
45
+ }, "expenseAutomationActualMatchingView/searchMatchTransactions", never, never>, searchMatchTransactionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
46
+ error: ZeniAPIStatus;
47
+ }, "expenseAutomationActualMatchingView/searchMatchTransactionsFailure">, searchMatchTransactionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
48
+ append: boolean;
49
+ nextPageToken: string | null;
50
+ results: ActualMatchingTransactionSearchResult[];
51
+ }, "expenseAutomationActualMatchingView/searchMatchTransactionsSuccess">, updateActualMatchingUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<ActualMatchingViewUIState>, "expenseAutomationActualMatchingView/updateActualMatchingUIState">;
52
+ declare const _default: import("redux").Reducer<ActualMatchingViewState>;
53
+ export default _default;
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.updateActualMatchingUIState = exports.searchMatchTransactionsSuccess = exports.searchMatchTransactionsFailure = exports.searchMatchTransactions = exports.searchMatchAccrualsSuccess = exports.searchMatchAccrualsFailure = exports.searchMatchAccruals = exports.openMatchNewModal = exports.matchAndReverseAccrualsSuccess = exports.matchAndReverseAccrualsFailure = exports.matchAndReverseAccruals = exports.fetchActualMatchingSuccess = exports.fetchActualMatchingPage = exports.fetchActualMatchingFailure = exports.fetchActualMatching = exports.closeMatchNewModal = exports.clearMatchNewModal = exports.clearActualMatchingView = exports.initialState = exports.initialMatchModalState = exports.initialAccrualSearchState = exports.initialTransactionSearchState = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ const timePeriod_1 = require("../../../commonStateTypes/timePeriod");
7
+ const jeScheduleHelper_1 = require("../../../entity/jeSchedules/jeScheduleHelper");
8
+ const rootActions_1 = require("../../../rootActions");
9
+ exports.initialTransactionSearchState = {
10
+ query: '',
11
+ results: [],
12
+ fetchState: 'Not-Started',
13
+ error: undefined,
14
+ nextPageToken: null,
15
+ isLoadingMore: false,
16
+ };
17
+ exports.initialAccrualSearchState = {
18
+ query: '',
19
+ results: [],
20
+ fetchState: 'Not-Started',
21
+ error: undefined,
22
+ nextPageToken: null,
23
+ isLoadingMore: false,
24
+ };
25
+ exports.initialMatchModalState = {
26
+ isOpen: false,
27
+ transactionSearch: exports.initialTransactionSearchState,
28
+ accrualSearch: exports.initialAccrualSearchState,
29
+ confirmStatus: { fetchState: 'Not-Started', error: undefined },
30
+ };
31
+ exports.initialState = {
32
+ accrualKeysByPeriod: {},
33
+ fetchState: 'Not-Started',
34
+ error: undefined,
35
+ refreshStatus: {
36
+ fetchState: 'Not-Started',
37
+ error: undefined,
38
+ },
39
+ uiState: {
40
+ sortKey: 'date',
41
+ sortOrder: 'descending',
42
+ searchString: '',
43
+ scrollPosition: { scrollTop: 0, scrollLeft: undefined },
44
+ },
45
+ matchModal: exports.initialMatchModalState,
46
+ hasValidState() {
47
+ return this.fetchState == 'Completed';
48
+ },
49
+ };
50
+ function resetMatchModalSearches(draft) {
51
+ draft.matchModal.transactionSearch = exports.initialTransactionSearchState;
52
+ draft.matchModal.accrualSearch = exports.initialAccrualSearchState;
53
+ draft.matchModal.confirmStatus = {
54
+ fetchState: 'Not-Started',
55
+ error: undefined,
56
+ };
57
+ draft.matchModal.lastBatchResults = undefined;
58
+ }
59
+ const expenseAutomationActualMatchingView = (0, toolkit_1.createSlice)({
60
+ name: 'expenseAutomationActualMatchingView',
61
+ initialState: exports.initialState,
62
+ reducers: {
63
+ fetchActualMatchingPage: {
64
+ prepare(period, refreshViewInBackground = false) {
65
+ return {
66
+ payload: {
67
+ period,
68
+ refreshViewInBackground,
69
+ },
70
+ };
71
+ },
72
+ reducer() {
73
+ // Epic-only fan-out.
74
+ },
75
+ },
76
+ fetchActualMatching: {
77
+ reducer(draft, action) {
78
+ const { refreshViewInBackground } = action.payload;
79
+ if (refreshViewInBackground) {
80
+ draft.refreshStatus = { fetchState: 'In-Progress', error: undefined };
81
+ }
82
+ else {
83
+ draft.fetchState = 'In-Progress';
84
+ draft.error = undefined;
85
+ }
86
+ },
87
+ prepare(period, refreshViewInBackground = false) {
88
+ return {
89
+ payload: {
90
+ period,
91
+ refreshViewInBackground,
92
+ },
93
+ };
94
+ },
95
+ },
96
+ fetchActualMatchingSuccess(draft, action) {
97
+ const { accruals, selectedPeriod, refreshViewInBackground } = action.payload;
98
+ const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
99
+ draft.accrualKeysByPeriod[periodId] = accruals.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
100
+ if (refreshViewInBackground) {
101
+ draft.refreshStatus = { fetchState: 'Completed', error: undefined };
102
+ }
103
+ else {
104
+ draft.fetchState = 'Completed';
105
+ draft.error = undefined;
106
+ }
107
+ },
108
+ fetchActualMatchingFailure(draft, action) {
109
+ const { status, refreshViewInBackground } = action.payload;
110
+ if (refreshViewInBackground) {
111
+ draft.refreshStatus = { fetchState: 'Error', error: status };
112
+ }
113
+ else {
114
+ draft.fetchState = 'Error';
115
+ draft.error = status;
116
+ }
117
+ },
118
+ updateActualMatchingUIState(draft, action) {
119
+ if (action.payload.sortKey != null) {
120
+ draft.uiState.sortKey = action.payload.sortKey;
121
+ }
122
+ if (action.payload.sortOrder != null) {
123
+ draft.uiState.sortOrder = action.payload.sortOrder;
124
+ }
125
+ if (action.payload.searchString != null) {
126
+ draft.uiState.searchString = action.payload.searchString;
127
+ }
128
+ if (action.payload.scrollPosition != null) {
129
+ draft.uiState.scrollPosition = action.payload.scrollPosition;
130
+ }
131
+ },
132
+ openMatchNewModal(draft) {
133
+ draft.matchModal.isOpen = true;
134
+ },
135
+ closeMatchNewModal(draft) {
136
+ draft.matchModal.isOpen = false;
137
+ resetMatchModalSearches(draft);
138
+ },
139
+ clearMatchNewModal(draft) {
140
+ draft.matchModal.isOpen = false;
141
+ resetMatchModalSearches(draft);
142
+ },
143
+ searchMatchTransactions: {
144
+ reducer(draft, action) {
145
+ const { query, pageToken } = action.payload;
146
+ const isLoadMore = pageToken != null;
147
+ draft.matchModal.transactionSearch.query = query;
148
+ if (isLoadMore) {
149
+ draft.matchModal.transactionSearch.isLoadingMore = true;
150
+ }
151
+ else {
152
+ draft.matchModal.transactionSearch.isLoadingMore = false;
153
+ draft.matchModal.transactionSearch.results = [];
154
+ draft.matchModal.transactionSearch.nextPageToken = null;
155
+ draft.matchModal.transactionSearch.fetchState = 'In-Progress';
156
+ draft.matchModal.transactionSearch.error = undefined;
157
+ }
158
+ },
159
+ prepare({ query, pageToken }) {
160
+ return { payload: { query, pageToken: pageToken ?? undefined } };
161
+ },
162
+ },
163
+ searchMatchTransactionsSuccess(draft, action) {
164
+ const { append, nextPageToken, results } = action.payload;
165
+ if (append) {
166
+ const merged = [
167
+ ...draft.matchModal.transactionSearch.results,
168
+ ...results,
169
+ ];
170
+ const byKey = new Map(merged.map((result) => [
171
+ `${result.transactionId}:${result.lineId}`,
172
+ result,
173
+ ]));
174
+ draft.matchModal.transactionSearch.results = Array.from(byKey.values());
175
+ }
176
+ else {
177
+ draft.matchModal.transactionSearch.results = results;
178
+ }
179
+ draft.matchModal.transactionSearch.nextPageToken = nextPageToken;
180
+ draft.matchModal.transactionSearch.isLoadingMore = false;
181
+ draft.matchModal.transactionSearch.fetchState = 'Completed';
182
+ draft.matchModal.transactionSearch.error = undefined;
183
+ },
184
+ searchMatchTransactionsFailure(draft, action) {
185
+ draft.matchModal.transactionSearch.isLoadingMore = false;
186
+ draft.matchModal.transactionSearch.fetchState = 'Error';
187
+ draft.matchModal.transactionSearch.error = action.payload.error;
188
+ },
189
+ searchMatchAccruals: {
190
+ reducer(draft, action) {
191
+ const { query, pageToken } = action.payload;
192
+ const isLoadMore = pageToken != null;
193
+ draft.matchModal.accrualSearch.query = query;
194
+ if (isLoadMore) {
195
+ draft.matchModal.accrualSearch.isLoadingMore = true;
196
+ }
197
+ else {
198
+ draft.matchModal.accrualSearch.isLoadingMore = false;
199
+ draft.matchModal.accrualSearch.results = [];
200
+ draft.matchModal.accrualSearch.nextPageToken = null;
201
+ draft.matchModal.accrualSearch.fetchState = 'In-Progress';
202
+ draft.matchModal.accrualSearch.error = undefined;
203
+ }
204
+ },
205
+ prepare({ query, pageToken }) {
206
+ return { payload: { query, pageToken: pageToken ?? undefined } };
207
+ },
208
+ },
209
+ searchMatchAccrualsSuccess(draft, action) {
210
+ const { append, nextPageToken, results } = action.payload;
211
+ const keys = results.map((accrual) => (0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrual._id));
212
+ if (append) {
213
+ const merged = [...draft.matchModal.accrualSearch.results, ...keys];
214
+ draft.matchModal.accrualSearch.results = Array.from(new Set(merged));
215
+ }
216
+ else {
217
+ draft.matchModal.accrualSearch.results = keys;
218
+ }
219
+ draft.matchModal.accrualSearch.nextPageToken = nextPageToken;
220
+ draft.matchModal.accrualSearch.isLoadingMore = false;
221
+ draft.matchModal.accrualSearch.fetchState = 'Completed';
222
+ draft.matchModal.accrualSearch.error = undefined;
223
+ },
224
+ searchMatchAccrualsFailure(draft, action) {
225
+ draft.matchModal.accrualSearch.isLoadingMore = false;
226
+ draft.matchModal.accrualSearch.fetchState = 'Error';
227
+ draft.matchModal.accrualSearch.error = action.payload.error;
228
+ },
229
+ matchAndReverseAccruals: {
230
+ reducer(draft) {
231
+ draft.matchModal.confirmStatus = {
232
+ fetchState: 'In-Progress',
233
+ error: undefined,
234
+ };
235
+ },
236
+ prepare(params) {
237
+ return { payload: params };
238
+ },
239
+ },
240
+ matchAndReverseAccrualsSuccess(draft, action) {
241
+ draft.matchModal.confirmStatus = {
242
+ fetchState: 'Completed',
243
+ error: undefined,
244
+ };
245
+ draft.matchModal.lastBatchResults = action.payload.results;
246
+ },
247
+ matchAndReverseAccrualsFailure(draft, action) {
248
+ draft.matchModal.confirmStatus = {
249
+ fetchState: 'Error',
250
+ error: action.payload.status,
251
+ };
252
+ },
253
+ clearActualMatchingView(draft) {
254
+ Object.assign(draft, exports.initialState);
255
+ },
256
+ },
257
+ extraReducers: (builder) => {
258
+ builder.addCase(rootActions_1.clearAll, (draft) => {
259
+ Object.assign(draft, exports.initialState);
260
+ });
261
+ },
262
+ });
263
+ _a = expenseAutomationActualMatchingView.actions, exports.clearActualMatchingView = _a.clearActualMatchingView, exports.clearMatchNewModal = _a.clearMatchNewModal, exports.closeMatchNewModal = _a.closeMatchNewModal, exports.fetchActualMatching = _a.fetchActualMatching, exports.fetchActualMatchingFailure = _a.fetchActualMatchingFailure, exports.fetchActualMatchingPage = _a.fetchActualMatchingPage, exports.fetchActualMatchingSuccess = _a.fetchActualMatchingSuccess, exports.matchAndReverseAccruals = _a.matchAndReverseAccruals, exports.matchAndReverseAccrualsFailure = _a.matchAndReverseAccrualsFailure, exports.matchAndReverseAccrualsSuccess = _a.matchAndReverseAccrualsSuccess, exports.openMatchNewModal = _a.openMatchNewModal, exports.searchMatchAccruals = _a.searchMatchAccruals, exports.searchMatchAccrualsFailure = _a.searchMatchAccrualsFailure, exports.searchMatchAccrualsSuccess = _a.searchMatchAccrualsSuccess, exports.searchMatchTransactions = _a.searchMatchTransactions, exports.searchMatchTransactionsFailure = _a.searchMatchTransactionsFailure, exports.searchMatchTransactionsSuccess = _a.searchMatchTransactionsSuccess, exports.updateActualMatchingUIState = _a.updateActualMatchingUIState;
264
+ exports.default = expenseAutomationActualMatchingView.reducer;