@zeniai/client-epic-state 5.2.11-betaRD5 → 5.2.11-betaRD7

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.
@@ -135,6 +135,27 @@ export interface JEAccruedScheduledTransactionState extends Omit<JEScheduledTran
135
135
  memo: string;
136
136
  recurringAmount: Amount;
137
137
  }
138
+ /**
139
+ * What a human can change on a draft accrual before posting it.
140
+ *
141
+ * Deliberately not the whole accrual: posting date is derived server-side from the service month,
142
+ * and vendor / service month are identity -- agent-je rejects a promote whose body disagrees with
143
+ * the stored draft on either.
144
+ */
145
+ export interface OneTimeAccrualEdits {
146
+ expectedReversalDate?: ZeniDate;
147
+ jeCreditAccountId?: ID;
148
+ jeDebitAccountId?: ID;
149
+ jeDebitAccountingClassId?: ID;
150
+ jeDebitAccountingClassName?: string;
151
+ memo?: string;
152
+ /**
153
+ * The Auto Reversal toggle, modelled as the same boolean the New form and the create payload use
154
+ * rather than a policy string: `reverse_next_month` alone decides the policy server-side, and
155
+ * sending both would be two sources of truth for one control.
156
+ */
157
+ reverseNextMonth?: boolean;
158
+ }
138
159
  export interface JEOneTimeAccrualCreator {
139
160
  userId: ID;
140
161
  email?: string;
@@ -1,6 +1,6 @@
1
1
  import { from, merge } from 'rxjs';
2
2
  import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
3
- import { convertToPeriod, toAbsoluteDay, } from '../../../../commonStateTypes/timePeriod';
3
+ import { DEFAULT_DATE_FORMAT, convertToPeriod, toAbsoluteDay, } from '../../../../commonStateTypes/timePeriod';
4
4
  import { generateJEOneTimeAccrualKey } from '../../../../entity/jeSchedules/jeScheduleHelper';
5
5
  import { updateJEOneTimeAccruals } from '../../../../entity/jeSchedules/jeSchedulesReducer';
6
6
  import { getJEOneTimeAccrualByKey } from '../../../../entity/jeSchedules/jeSchedulesSelector';
@@ -50,21 +50,44 @@ messageSection, accrualId, message, status) {
50
50
  }
51
51
  export const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(promoteOneTimeAccrual.match), mergeMap((action) => {
52
52
  const state = state$.value;
53
- const { accrualId, amount } = action.payload;
53
+ const { accrualId, amount, edits } = action.payload;
54
54
  const accrual = getJEOneTimeAccrualByKey(generateJEOneTimeAccrualKey(accrualId), state.jeSchedulesState);
55
- if (accrual?.jeDebitAccountId == null ||
56
- accrual.jeCreditAccountId == null) {
55
+ // An edited value wins; anything untouched falls back to the stored draft, which is what the
56
+ // list's inline Post sends.
57
+ const debitAccountId = edits?.jeDebitAccountId ?? accrual?.jeDebitAccountId;
58
+ const creditAccountId = edits?.jeCreditAccountId ?? accrual?.jeCreditAccountId;
59
+ if (debitAccountId == null || creditAccountId == null) {
57
60
  // Promote posts a journal entry, so it cannot proceed without both sides of it.
58
61
  return from(failureActions('save_schedule', accrualId, 'This accrual is missing an expense or liability account.'));
59
62
  }
60
63
  // vendor_id, vendor_name and service_month are deliberately absent: promote takes them from
61
64
  // the stored draft and ignores them in the body, so sending them would imply a reassignment
62
65
  // that never happens.
66
+ // Untouched falls back to the stored policy, so posting without editing cannot silently
67
+ // flip a scheduled reversal to on-bill-match.
68
+ const reverseNextMonth = edits?.reverseNextMonth ??
69
+ accrual?.reversalPolicy === 'scheduled_date';
70
+ const expectedReversalDate = edits?.expectedReversalDate ?? accrual?.expectedReversalDate;
71
+ const debitClassId = edits?.jeDebitAccountingClassId ?? accrual?.jeDebitAccountingClassId;
72
+ const debitClassName = edits?.jeDebitAccountingClassName ??
73
+ accrual?.jeDebitAccountingClassName;
63
74
  const payload = {
64
75
  amount,
65
- memo: accrual.memo,
66
- je_debit_account_id: accrual.jeDebitAccountId,
67
- je_credit_account_id: accrual.jeCreditAccountId,
76
+ memo: edits?.memo ?? accrual?.memo ?? '',
77
+ je_debit_account_id: debitAccountId,
78
+ je_credit_account_id: creditAccountId,
79
+ ...(debitClassId != null ? { je_debit_accounting_class_id: debitClassId } : {}),
80
+ ...(debitClassName != null
81
+ ? { je_debit_accounting_class_name: debitClassName }
82
+ : {}),
83
+ // Mirrors the create payload: reverse_next_month alone decides the policy, and the date is
84
+ // only meaningful when it is true -- agent-je derives the reversal from the bill otherwise.
85
+ reverse_next_month: reverseNextMonth,
86
+ ...(reverseNextMonth && expectedReversalDate != null
87
+ ? {
88
+ expected_reversal_date: expectedReversalDate.format(DEFAULT_DATE_FORMAT),
89
+ }
90
+ : {}),
68
91
  };
69
92
  return zeniAPI
70
93
  .putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/${accrualId}`, { ...payload })
@@ -80,7 +103,7 @@ export const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$
80
103
  variables: [
81
104
  {
82
105
  variableName: '_vendor_name_',
83
- variableValue: accrual.vendorName,
106
+ variableValue: accrual?.vendorName ?? '',
84
107
  },
85
108
  ],
86
109
  }),
@@ -574,9 +574,14 @@ const expenseAutomationJESchedulesView = createSlice({
574
574
  error: action.payload.status,
575
575
  };
576
576
  },
577
+ /**
578
+ * Promote applies the body and posts in one step, so it carries whatever the user edited on the
579
+ * detail page. `edits` is absent when nothing was changed -- the epic then falls back to the
580
+ * stored accrual, which is what the list's inline Post does.
581
+ */
577
582
  promoteOneTimeAccrual: {
578
- prepare(accrualId, amount) {
579
- return { payload: { accrualId, amount } };
583
+ prepare(accrualId, amount, edits) {
584
+ return { payload: { accrualId, amount, edits } };
580
585
  },
581
586
  reducer(draft, action) {
582
587
  draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
package/lib/index.d.ts CHANGED
@@ -108,7 +108,7 @@ import { TrendChangeType } from './entity/insights/insightPayload';
108
108
  import { Insight } from './entity/insights/insightState';
109
109
  import { InsightSummary } from './entity/insights/insightSummary';
110
110
  import { JEAccruedSchedule, JEOneTimeAccrual, JEScheduledTransaction, ScheduledJournalEntry } from './entity/jeSchedules/jeSchedulesSelector';
111
- import { JEOneTimeAccrualAiSuggestion, JEOneTimeAccrualBillingPattern, JEOneTimeAccrualMonthlyTotal, JEOneTimeAccrualProfileSnapshot, JEScheduleAISummaries, JEScheduleFieldRecommendation, JEScheduleSummary } from './entity/jeSchedules/jeSchedulesState';
111
+ import { JEOneTimeAccrualAiSuggestion, JEOneTimeAccrualBillingPattern, JEOneTimeAccrualMonthlyTotal, JEOneTimeAccrualProfileSnapshot, JEScheduleAISummaries, JEScheduleFieldRecommendation, JEScheduleSummary, OneTimeAccrualEdits } from './entity/jeSchedules/jeSchedulesState';
112
112
  import { ALL_JE_SCHEDULE_IGNORE_REASONS, ALL_JE_SCHEDULE_REVERT_REASONS, ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS, ALL_ONE_TIME_ACCRUAL_REVERT_REASONS, ALL_SCHEDULES_TYPES, JEOneTimeAccrualKey, JEScheduleIgnoreReasonType, JEScheduleKey, JEScheduleRevertReasonType, JEScheduleTransactionKey, JournalEntryErrorCodeType, OneTimeAccrualIgnoreReasonType, OneTimeAccrualRevertReasonType, ScheduleJournalEntryStatusCodeType, ScheduleStatusCodeType, ScheduleTransactionID, ScheduleTypes, getJEScheduleTransactionKey, toScheduleTypesType, toScheduleTypesTypeStrict } from './entity/jeSchedules/jeSchedulesTypes';
113
113
  import { Merchant } from './entity/merchant/merchant';
114
114
  import { ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, MonthCloseCheckMetrics, MonthCloseCheckProgressJson, MonthEndAuditSummary, MonthEndCloseCheck, MonthEndCloseCheckFrequency } from './entity/monthEndCloseChecks/monthEndCloseChecksState';
@@ -940,7 +940,7 @@ export { fetchApAgingDetail, AgingReportInvoice, ApAgingDetail, getApAgingDetail
940
940
  export { LinkBillExpenseKey };
941
941
  export { clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, clearJeSearchTransactionsForNewSchedule, fetchExpenseAutomationJESchedulesPage, ignoreExpenseAutomationJESchedule, initializeJeAccountSettingsView, initializeJeNewSchedule, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, resetJeNewScheduleLocalData, retryExpenseAutomationJESchedule, saveJeNewSchedule, saveJeNewScheduleFailure, saveJeNewScheduleSuccess, searchJeTransactionsForNewSchedule, searchJeTransactionsForNewScheduleFailure, searchJeTransactionsForNewScheduleSuccess, updateExpenseAutomationJESchedulesUIState, updateJeNewScheduleLocalData, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, };
942
942
  export { createNewSchedulesAccrued, deleteScheduleAccruedDetail, cancelScheduleAccruedJournalEntry, fetchScheduleAccruedDetails, fetchScheduleAccruedDetailsPage, resetJEAccruedLinkInLocalData, saveScheduleAccruedDetails, updateAmountsInScheduleAccruedDetail, updatedJEAccruedLinkWithRecommendedLocalData, updatedJELinkInLocalDataAccruedExpenses, fetchRecommendedTransactionRowIndex, clearSelectedJELinkRowIndex, updateLinkBillExpenseLocalData, updateScheduleAccruedDetailsLocalData, updateSelectedJEAccruedScheduleKey, resetSelectedJEAccruedScheduleKey, resetAccruedDetailNewScheduleState, };
943
- export { JEScheduleKey, JEScheduleTransactionKey, ScheduleTransactionID, getJEScheduleTransactionKey, ALL_JE_SCHEDULE_IGNORE_REASONS, ALL_JE_SCHEDULE_REVERT_REASONS, ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS, ALL_ONE_TIME_ACCRUAL_REVERT_REASONS, ALL_SCHEDULES_TYPES, JEScheduledTransaction, JEAccruedSchedule, JEOneTimeAccrual, JEOneTimeAccrualAiSuggestion, JEOneTimeAccrualBillingPattern, JEOneTimeAccrualMonthlyTotal, JEOneTimeAccrualProfileSnapshot, JEOneTimeAccrualKey, JEScheduleAISummaries, JEScheduleFieldRecommendation, JEScheduleSummary, ScheduleTypes, ScheduleJournalEntryStatusCodeType, ScheduleListReport, ScheduleAccruedListReport, getScheduleListReport, getAccruedScheduleListReport, ScheduleSubTabType, ScheduleListSortKey, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, ScheduleListLocalData, ScheduleDetailsLocalDataFixedAssets, ScheduleDetailsLocalDataAccruedExpenses, ScheduleDetailsView, ScheduleAccruedDetailsView, LinkBillExpenseView, LinkBillExpenseLocalData, JEScheduleDetailsLocalData, ScheduleDetailsLocalData, toScheduleSubTabType, ScheduleStatusCodeType, JEScheduleIgnoreReasonType, JEScheduleRevertReasonType, JournalEntryErrorCodeType, OneTimeAccrualIgnoreReasonType, OneTimeAccrualRevertReasonType, ScheduleTransaction, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, ScheduleDetailSortKey, ScheduledJournalEntry, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, JETransactionLink, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, DownloadJEScheduleTabOptions, updatedSelectedJELinkRowIndex, ScheduleListTabsFileType, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, ScheduleDetailUIState, resetJELinkInLocalData, JEScheduledTransactionWithBalance, JEScheduleWithBalance, JELinkType, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, VendorTabViewTabType, getVendorTabView, VendorTabViewSelectorView, };
943
+ export { JEScheduleKey, JEScheduleTransactionKey, ScheduleTransactionID, getJEScheduleTransactionKey, ALL_JE_SCHEDULE_IGNORE_REASONS, ALL_JE_SCHEDULE_REVERT_REASONS, ALL_ONE_TIME_ACCRUAL_IGNORE_REASONS, ALL_ONE_TIME_ACCRUAL_REVERT_REASONS, ALL_SCHEDULES_TYPES, JEScheduledTransaction, JEAccruedSchedule, JEOneTimeAccrual, OneTimeAccrualEdits, JEOneTimeAccrualAiSuggestion, JEOneTimeAccrualBillingPattern, JEOneTimeAccrualMonthlyTotal, JEOneTimeAccrualProfileSnapshot, JEOneTimeAccrualKey, JEScheduleAISummaries, JEScheduleFieldRecommendation, JEScheduleSummary, ScheduleTypes, ScheduleJournalEntryStatusCodeType, ScheduleListReport, ScheduleAccruedListReport, getScheduleListReport, getAccruedScheduleListReport, ScheduleSubTabType, ScheduleListSortKey, fetchScheduleList, fetchAccruedScheduleList, fetchDownloadSchedules, fetchSchedulesAccount, updateScheduleListLocalData, getFetchStateForScheduleAccountList, toScheduleTypesType, toScheduleTypesTypeStrict, toScheduleListTabsFileTypeStrict, ScheduleListLocalData, ScheduleDetailsLocalDataFixedAssets, ScheduleDetailsLocalDataAccruedExpenses, ScheduleDetailsView, ScheduleAccruedDetailsView, LinkBillExpenseView, LinkBillExpenseLocalData, JEScheduleDetailsLocalData, ScheduleDetailsLocalData, toScheduleSubTabType, ScheduleStatusCodeType, JEScheduleIgnoreReasonType, JEScheduleRevertReasonType, JournalEntryErrorCodeType, OneTimeAccrualIgnoreReasonType, OneTimeAccrualRevertReasonType, ScheduleTransaction, updateScheduleListSubTab, updateScheduleListSearchText, updateScheduleListScrollState, updateScheduleListSortState, ScheduleDetailSortKey, ScheduledJournalEntry, updateSelectedJEScheduleKey, fetchScheduleDetails, getScheduleDetailsView, getAccruedScheduleDetailsView, fetchScheduleDetailsPage, saveScheduleDetails, deleteScheduleDetail, createNewSchedules, updateScheduleDetailsLocalData, JETransactionLink, updateScheduleListDownloadState, updateAccruedJEScheduleAccruedByListKey, DownloadJEScheduleTabOptions, updatedSelectedJELinkRowIndex, ScheduleListTabsFileType, getQBOUrlForLink, getThirdPartyIDFromQBOURL, updatedJELinkInLocalData, updateAmountsInScheduleDetail, ScheduleDetailUIState, resetJELinkInLocalData, JEScheduledTransactionWithBalance, JEScheduleWithBalance, JELinkType, updatedJELinkWithRecommendedLocalData, getFetchStateForScheduleListByType, getDefaultSelectedTimeframeForScheduleType, markAsCompleteScheduleDetail, resetMarkAsCompleteStatus, fetchVendorTabView, updateVendorTabViewTab, VendorTabViewTabType, getVendorTabView, VendorTabViewSelectorView, };
944
944
  export { GlobalMerchant, GlobalMerchantBase, TenantMerchant };
945
945
  export { ReviewStatus, VendorTransactionAttachment, VendorTransactionAttachmentPayload, VendorFirstReviewViewSelectorView, VendorFirstReviewViewLocalData, VendorFirstReviewSelectorView, VendorFirstReviewSelectorAttachmentView, VendorFirstReviewViewUIState, VendorFirstReviewViewColumnKey, GlobalMerchantAutoCompleteView, VendorReviewRowCurrentSelection, toVendorFirstReviewViewColumnKeyType, RecommendedNonExistingGlobalMerchant, getGlobalMerchantAutoCompleteResults, VendorReviewRecommendationViewState, GlobalMerchantType, getVendorFirstReviewView, getVendorFirstReviewAttachmentView, fetchVendorFirstReviewView, fetchVendorFirstReviewAttachments, updateVendorFirstReviewViewScrollYOffset, resetVendorFirstReviewLocalData, updateVendorFirstReviewViewPageToken, clearRecentlySavedErroredVendorData, saveVendorFirstReviewView, updateVendorFirstReviewViewLocalData, updateVendorFirstReviewSortUiState, fetchGlobalMerchantAutoCompleteView, clearGlobalMerchantAutoCompleteResults, GlobalVendorReviewRowCurrentSelection, FirstReviewPageCurrentSelectionByColumn, updateReviewVendorDetailLocalData, saveVendorDetailsView, getVendorDetailSelectorView, FirstReviewVendorDetailSelectorView, VendorViewLocalData, };
946
946
  export { fetchGlobalMerchantRecommendation, createGlobalMerchant, updateCreateGlobalMerchantLocalData, clearGlobalMerchantView, getGlobalMerchantView, GlobalMerchantViewSelectorView, GlobalMerchantViewState, NewGlobalMerchantData, NewGlobalMerchantCurrentSelection, };
@@ -53,21 +53,44 @@ messageSection, accrualId, message, status) {
53
53
  }
54
54
  const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.promoteOneTimeAccrual.match), (0, operators_1.mergeMap)((action) => {
55
55
  const state = state$.value;
56
- const { accrualId, amount } = action.payload;
56
+ const { accrualId, amount, edits } = action.payload;
57
57
  const accrual = (0, jeSchedulesSelector_1.getJEOneTimeAccrualByKey)((0, jeScheduleHelper_1.generateJEOneTimeAccrualKey)(accrualId), state.jeSchedulesState);
58
- if (accrual?.jeDebitAccountId == null ||
59
- accrual.jeCreditAccountId == null) {
58
+ // An edited value wins; anything untouched falls back to the stored draft, which is what the
59
+ // list's inline Post sends.
60
+ const debitAccountId = edits?.jeDebitAccountId ?? accrual?.jeDebitAccountId;
61
+ const creditAccountId = edits?.jeCreditAccountId ?? accrual?.jeCreditAccountId;
62
+ if (debitAccountId == null || creditAccountId == null) {
60
63
  // Promote posts a journal entry, so it cannot proceed without both sides of it.
61
64
  return (0, rxjs_1.from)(failureActions('save_schedule', accrualId, 'This accrual is missing an expense or liability account.'));
62
65
  }
63
66
  // vendor_id, vendor_name and service_month are deliberately absent: promote takes them from
64
67
  // the stored draft and ignores them in the body, so sending them would imply a reassignment
65
68
  // that never happens.
69
+ // Untouched falls back to the stored policy, so posting without editing cannot silently
70
+ // flip a scheduled reversal to on-bill-match.
71
+ const reverseNextMonth = edits?.reverseNextMonth ??
72
+ accrual?.reversalPolicy === 'scheduled_date';
73
+ const expectedReversalDate = edits?.expectedReversalDate ?? accrual?.expectedReversalDate;
74
+ const debitClassId = edits?.jeDebitAccountingClassId ?? accrual?.jeDebitAccountingClassId;
75
+ const debitClassName = edits?.jeDebitAccountingClassName ??
76
+ accrual?.jeDebitAccountingClassName;
66
77
  const payload = {
67
78
  amount,
68
- memo: accrual.memo,
69
- je_debit_account_id: accrual.jeDebitAccountId,
70
- je_credit_account_id: accrual.jeCreditAccountId,
79
+ memo: edits?.memo ?? accrual?.memo ?? '',
80
+ je_debit_account_id: debitAccountId,
81
+ je_credit_account_id: creditAccountId,
82
+ ...(debitClassId != null ? { je_debit_accounting_class_id: debitClassId } : {}),
83
+ ...(debitClassName != null
84
+ ? { je_debit_accounting_class_name: debitClassName }
85
+ : {}),
86
+ // Mirrors the create payload: reverse_next_month alone decides the policy, and the date is
87
+ // only meaningful when it is true -- agent-je derives the reversal from the bill otherwise.
88
+ reverse_next_month: reverseNextMonth,
89
+ ...(reverseNextMonth && expectedReversalDate != null
90
+ ? {
91
+ expected_reversal_date: expectedReversalDate.format(timePeriod_1.DEFAULT_DATE_FORMAT),
92
+ }
93
+ : {}),
71
94
  };
72
95
  return zeniAPI
73
96
  .putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accruals/${accrualId}`, { ...payload })
@@ -83,7 +106,7 @@ const promoteOneTimeAccrualEpic = (actions$, state$, zeniAPI) => actions$.pipe((
83
106
  variables: [
84
107
  {
85
108
  variableName: '_vendor_name_',
86
- variableValue: accrual.vendorName,
109
+ variableValue: accrual?.vendorName ?? '',
87
110
  },
88
111
  ],
89
112
  }),
@@ -52,11 +52,25 @@ export type CreateOneTimeAccrualResponse = ZeniAPIResponse<{
52
52
  * treats them as immutable and takes them from the existing draft, so sending them would imply a
53
53
  * reassignment the API silently ignores.
54
54
  */
55
+ /**
56
+ * The body agent-je's `promote_draft` reads. Promote is the only write path for a draft accrual --
57
+ * it applies the body and posts the JE in one step -- so every field a human can edit on the detail
58
+ * page travels here.
59
+ *
60
+ * `posting_date` is absent on purpose: agent-je derives it from the accrual's service month and
61
+ * ignores any value sent for it.
62
+ */
55
63
  export interface PromoteOneTimeAccrualPayload {
56
64
  amount: number;
57
65
  je_credit_account_id: ID;
58
66
  je_debit_account_id: ID;
59
67
  memo: string;
68
+ expected_reversal_date?: string;
69
+ je_credit_accounting_class_id?: ID;
70
+ je_credit_accounting_class_name?: string;
71
+ je_debit_accounting_class_id?: ID;
72
+ je_debit_accounting_class_name?: string;
73
+ reverse_next_month?: boolean;
60
74
  }
61
75
  /**
62
76
  * Ignore body. `scope` is deliberately absent — the API returns 400 if it is sent, which is why the
@@ -3,6 +3,7 @@ import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePerio
3
3
  import { AccountMetadataPayload } from '../../../entity/account/accountPayload';
4
4
  import { JEAccruedScheduledTransactionPayload, JEOneTimeAccrualPayload, JEScheduledTransactionPayload } from '../../../entity/jeSchedules/jeSchedulesPayload';
5
5
  import { JEScheduleKey, JEScheduleTransactionKey, ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes';
6
+ import { OneTimeAccrualEdits } from '../../../entity/jeSchedules/jeSchedulesState';
6
7
  import { ZeniAPIStatus } from '../../../responsePayload';
7
8
  import { AccountTypeRecommendationPayload } from '../../accountMappingView/accountTypeRecommendation/accountTypeRecommendationPayload';
8
9
  import { AccountSettingsLocalData, AccountSettingsState, JEPageTab, JEScheduleLocalData, JESchedulesViewState, JESchedulesViewUIState, NewOneTimeAccrualLocalData, NewScheduleLocalData, NewScheduleLocalDataFixedAssets, SearchTransactionsState } from '../types/jeSchedulesViewState';
@@ -24,9 +25,10 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
24
25
  status: ZeniAPIStatus;
25
26
  }, "expenseAutomationJESchedulesView/oneTimeAccrualActionFailure">, oneTimeAccrualActionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
26
27
  accrualId: ID;
27
- }, "expenseAutomationJESchedulesView/oneTimeAccrualActionSuccess">, promoteOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, amount: number], {
28
+ }, "expenseAutomationJESchedulesView/oneTimeAccrualActionSuccess">, promoteOneTimeAccrual: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accrualId: string, amount: number, edits?: OneTimeAccrualEdits | undefined], {
28
29
  accrualId: string;
29
30
  amount: number;
31
+ edits: OneTimeAccrualEdits | undefined;
30
32
  }, "expenseAutomationJESchedulesView/promoteOneTimeAccrual", never, never>, revertJeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[jeScheduleId: string, jeScheduleTransactionKey: `${string}_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${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}`, scheduleType: "prepaid_expenses" | "fixed_assets" | "accrued_expenses" | "deferred_revenue", reason: "duplicate" | "amount_off" | "wrong_period" | "created_by_mistake" | "other_revert", note?: string | undefined], {
31
33
  jeScheduleId: string;
32
34
  jeScheduleTransactionKey: `${string}_${string}` | `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_refund_${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}`;
@@ -580,9 +580,14 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
580
580
  error: action.payload.status,
581
581
  };
582
582
  },
583
+ /**
584
+ * Promote applies the body and posts in one step, so it carries whatever the user edited on the
585
+ * detail page. `edits` is absent when nothing was changed -- the epic then falls back to the
586
+ * stored accrual, which is what the list's inline Post does.
587
+ */
583
588
  promoteOneTimeAccrual: {
584
- prepare(accrualId, amount) {
585
- return { payload: { accrualId, amount } };
589
+ prepare(accrualId, amount, edits) {
590
+ return { payload: { accrualId, amount, edits } };
586
591
  },
587
592
  reducer(draft, action) {
588
593
  draft.oneTimeAccrualActionStatusById[action.payload.accrualId] = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.11-betaRD5",
3
+ "version": "5.2.11-betaRD7",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",