import { StatusCodeWithLabelPayload } from '../../commonPayloadTypes/statusPayload'; import { ID } from '../../commonStateTypes/common'; import { AccountPayload } from '../account/accountPayload'; import { ClassBasePayload } from '../class/classPayload'; import { ScheduleTransactionPayload } from '../transaction/payloadTypes/scheduleTransactionPayload'; import { TransactionIDPayload } from '../transaction/payloadTypes/transactionIDPayload'; import { TransactionCategory } from '../transaction/stateTypes/transactionType'; import { UserPayload } from '../user/userPayload'; import { VendorPayload } from '../vendor/vendorPayload'; import { JEAccruedScheduledTransactionState, JEOneTimeAccrualState, JEScheduledTransactionState, ScheduledJournalEntryState } from './jeSchedulesState'; import { JEScheduleKey, JEScheduleTransactionKey } from './jeSchedulesTypes'; export interface JEScheduleOtherAttributesPayload { asset_id?: string | null; starting_balance?: number | null; } export interface JEScheduleAISummaryFieldPayload { confidence: number; reasoning: string; cot?: string[]; predicted_value?: number | string; } /** The whole-recommendation summary. Carries narrative only -- no predicted value, no confidence. */ export interface JEScheduleSummaryPayload { confidence?: number; cot?: string[]; reasoning?: string; reasoning_long?: string; } export interface JEScheduleAISummariesPayload { credit_account?: JEScheduleAISummaryFieldPayload; credit_accounting_class?: JEScheduleAISummaryFieldPayload; debit_account?: JEScheduleAISummaryFieldPayload; debit_accounting_class?: JEScheduleAISummaryFieldPayload; end_date?: JEScheduleAISummaryFieldPayload; period?: JEScheduleAISummaryFieldPayload; posting_date?: JEScheduleAISummaryFieldPayload; posting_start_date?: JEScheduleAISummaryFieldPayload; schedule_summary?: JEScheduleSummaryPayload; schedule_type?: JEScheduleAISummaryFieldPayload; starting_month?: JEScheduleAISummaryFieldPayload; } export interface JEScheduleRecommendationsPayload { credit_account_confidence?: number; credit_class_confidence?: number; debit_account_confidence?: number; debit_class_confidence?: number; end_date?: string | null; je_credit_account_id?: string | null; je_credit_accounting_class_id?: string | null; je_debit_account_id?: string | null; je_debit_accounting_class_id?: string | null; je_schedule_type?: string | null; je_schedule_type_confidence?: number; period?: number | null; period_confidence?: number; posting_date?: string | null; posting_date_confidence?: number; similar_transactions?: unknown[]; start_date?: string | null; starting_month?: string | null; starting_month_confidence?: number; } export interface JEScheduledTransactionPayload { balance: number | null; base_transaction: ScheduleTransactionPayload; currency_code: string; currency_symbol: string; je_credit_account_id: string | null; je_credit_account_name: string | null; je_credit_accounting_class_id: string | null; je_credit_accounting_class_name: string | null; je_debit_account_id: string | null; je_debit_account_name: string | null; je_debit_accounting_class_id: string | null; je_debit_accounting_class_name: string | null; je_schedule_id: ID | null; je_schedule_type: string | null; other_attributes: JEScheduleOtherAttributesPayload; period: number | null; posting_date: number | null; start_date: string | null; status: StatusCodeWithLabelPayload; updated_by: UserPayload; vendor: VendorPayload; ai_summaries?: JEScheduleAISummariesPayload; confidence_score?: number | null; create_time?: string | null; created_by?: UserPayload; end_date?: string | null; posted_count?: number | null; recommendations?: JEScheduleRecommendationsPayload; recurring_amount?: number | null; updated_at?: string | null; } export interface JEAccruedScheduledTransactionPayload extends Omit { create_time: string; je_schedule_id: ID; je_schedule_type: string; memo: string; recurring_amount: number; } /** * The frozen vendor profile the Cron used to decide an accrual, so the detail page can show its * reasoning even after the live profile is rebuilt. Present on agent/Cron rows ONLY — a human-created * accrual carries none, which is why every consumer has to treat it as absent rather than empty. */ export interface JEOneTimeAccrualProfileSnapshotPayload { billing_pattern?: { avg_amount?: number | null; billing_lag_days?: number | null; consistency_score?: number | null; frequency?: string | null; last_bill_amount?: number | null; last_bill_date?: string | null; months_of_history?: number | null; typical_bill_day?: number | null; } | null; monthly_totals?: Record | null; sorted_months?: string[] | null; } /** The JE the AI originally suggested, frozen at draft time for suggested-vs-posted comparison. */ export interface JEOneTimeAccrualAiSuggestionPayload { estimated_amount?: number | null; je_credit_account_id?: ID | null; je_credit_account_name?: string | null; je_debit_account_id?: ID | null; je_debit_account_name?: string | null; memo?: string | null; } export interface JEOneTimeAccrualPayload { _id: ID; estimated_amount: number; origin: string; service_month: string; status: string; vendor_id: ID; vendor_name: string; actual_post_date?: string | null; actual_reversal_post_date?: string | null; ai_suggestion?: JEOneTimeAccrualAiSuggestionPayload | null; automation_tier?: string | null; created_by_user?: UserPayload | null; currency?: string | null; expected_reversal_date?: string | null; is_ignored?: boolean; je_credit_account_id?: ID | null; je_credit_account_name?: string | null; je_credit_accounting_class_id?: ID | null; je_credit_accounting_class_name?: string | null; je_debit_account_id?: ID | null; je_debit_account_name?: string | null; je_debit_accounting_class_id?: ID | null; je_debit_accounting_class_name?: string | null; memo?: string | null; posting_date?: string | null; profile_snapshot?: JEOneTimeAccrualProfileSnapshotPayload | null; reversal_policy?: string | null; reversal_transaction_id?: ID | null; reversal_trigger?: string | null; transaction_id?: ID | null; transaction_integration_id?: ID | null; } export interface ScheduledJournalEntryPayload { actual_post_date: string | null; create_time: string | null; expected_post_date: string; recommended_transaction_id: string | null; reversal_third_party_id: string | null; reversal_transaction_id: string | null; status: StatusCodeWithLabelPayload; third_party_id: string | null; transaction_id: string | null; transaction_memo: string; update_time: string | null; actual_reversal_post_date?: string | null; amount?: number | null; balance?: number | null; errors?: string[] | null; is_bill_linked?: boolean | null; is_platform_generated?: boolean | null; je_schedule_id?: string | null; reversal_transaction_details?: TransactionIDPayload | null; scheduled_journal_entry_id?: string | null; } export declare function toScheduledJournalEntryState(payload: ScheduledJournalEntryPayload, currency_code: string, currency_symbol: string): ScheduledJournalEntryState; export declare function toJEAccountPayload(payload: JEScheduledTransactionPayload | JEAccruedScheduledTransactionPayload, type: TransactionCategory): AccountPayload | undefined; export declare function toJEAccruedAccountPayload(payload: JEScheduledTransactionPayload | JEAccruedScheduledTransactionPayload, type: TransactionCategory): AccountPayload | undefined; export declare function toJEClassPayload(payload: JEScheduledTransactionPayload | JEAccruedScheduledTransactionPayload, type: TransactionCategory): ClassBasePayload | undefined; export declare function getJEScheduleTransactionDetailKeyPayload(payload: ScheduleTransactionPayload): JEScheduleTransactionKey; export declare function getJEScheduleKey(payload: JEAccruedScheduledTransactionPayload): JEScheduleKey; export declare function toJEScheduledTransaction(payload: JEScheduledTransactionPayload): JEScheduledTransactionState; export declare function toJEAccruedScheduledTransaction(payload: JEAccruedScheduledTransactionPayload): JEAccruedScheduledTransactionState; export declare function toJEOneTimeAccrual(payload: JEOneTimeAccrualPayload): JEOneTimeAccrualState;