import { Amount } from '../../../commonStateTypes/amount'; import { ScheduleTypes } from '../../../entity/jeSchedules/jeSchedulesTypes'; import { ScheduleTransaction } from '../../../entity/transaction/stateTypes/scheduleTransaction'; import { JESchedulePayload, SaveJESchedulePayload } from '../../scheduleView/scheduleDetailView/scheduleDetailPayload'; import { NewJeDetailLocalData, NewScheduleLocalData, NewScheduleLocalDataFixedAssets } from '../types/jeSchedulesViewState'; /** * Computes the month-by-month JE schedule breakdown for a brand-new schedule * (no linked transaction yet) — replicates createNewSchedulesHelper's math * (scheduleDetailLocalDataHelper.ts) exactly: lump-sum total split evenly * across months with the rounding remainder absorbed by the last month, and a * running balance that decrements each month and is forced to exactly 0 on * the last row. */ export declare const computeNewScheduleJeDetails: (localData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets, totalAmount: Amount, vendorName: string) => NewJeDetailLocalData[]; export interface NewSchedulePayload { je_schedules: JESchedulePayload[]; scheduled_journal_entries: SaveJESchedulePayload[]; } export type PrepareNewSchedulePayloadFailureReason = 'missing_third_party_id' | 'missing_vendor'; export type PrepareNewSchedulePayloadResult = { ok: true; payload: NewSchedulePayload; } | { ok: false; reason: PrepareNewSchedulePayloadFailureReason; }; /** * Builds a savable schedule payload directly from a Base Transaction search * result and the New Schedule form's local data — bypassing the legacy * getJEScheduledTransactionByJEScheduleTransactionKey selector entirely, * since that selector throws unless the entity has already round-tripped * through a real GET /1.0/schedules/:id. A brand-new schedule has no such * history, so this reads only from data already in hand (the selected * transaction/line plus what the user filled into the form). */ export declare const prepareNewSchedulePayload: (transaction: ScheduleTransaction, localData: NewScheduleLocalData | NewScheduleLocalDataFixedAssets, scheduleType: ScheduleTypes) => PrepareNewSchedulePayloadResult;