import { type InvoiceRecord } from "../schemas.js"; export interface CreateInvoiceInput { invoiceNumber: string; bookingId: string; personId?: string | null; organizationId?: string | null; status?: InvoiceRecord["status"]; currency: string; subtotalCents?: number; taxCents?: number; totalCents?: number; paidCents?: number; balanceDueCents?: number; issueDate: string; dueDate: string; notes?: string | null; } export type UpdateInvoiceInput = Partial; export interface VoidInvoiceInput { reason?: string | null; } export declare function useInvoiceMutation(): { create: import("@tanstack/react-query").UseMutationResult<{ [x: string]: unknown; id: string; invoiceNumber: string; bookingId: string; personId: string | null; organizationId: string | null; status: "paid" | "void" | "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "overdue"; currency: string; subtotalCents: number; taxCents: number; totalCents: number; paidCents: number; balanceDueCents: number; issueDate: string; dueDate: string; notes: string | null; createdAt: string; updatedAt: string; invoiceType?: "invoice" | "proforma" | "credit_note" | undefined; voidedAt?: string | null | undefined; voidReason?: string | null | undefined; bookingPaymentScheduleIds?: string[] | undefined; convertedToInvoiceId?: string | null | undefined; convertedToInvoiceNumber?: string | null | undefined; }, Error, CreateInvoiceInput, unknown>; createFromBooking: import("@tanstack/react-query").UseMutationResult<{ [x: string]: unknown; id: string; invoiceNumber: string; bookingId: string; personId: string | null; organizationId: string | null; status: "paid" | "void" | "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "overdue"; currency: string; subtotalCents: number; taxCents: number; totalCents: number; paidCents: number; balanceDueCents: number; issueDate: string; dueDate: string; notes: string | null; createdAt: string; updatedAt: string; invoiceType?: "invoice" | "proforma" | "credit_note" | undefined; voidedAt?: string | null | undefined; voidReason?: string | null | undefined; bookingPaymentScheduleIds?: string[] | undefined; convertedToInvoiceId?: string | null | undefined; convertedToInvoiceNumber?: string | null | undefined; }, Error, CreateInvoiceFromBookingInput, unknown>; convertToInvoice: import("@tanstack/react-query").UseMutationResult<{ [x: string]: unknown; id: string; invoiceNumber: string; bookingId: string; personId: string | null; organizationId: string | null; status: "paid" | "void" | "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "overdue"; currency: string; subtotalCents: number; taxCents: number; totalCents: number; paidCents: number; balanceDueCents: number; issueDate: string; dueDate: string; notes: string | null; createdAt: string; updatedAt: string; invoiceType?: "invoice" | "proforma" | "credit_note" | undefined; voidedAt?: string | null | undefined; voidReason?: string | null | undefined; bookingPaymentScheduleIds?: string[] | undefined; convertedToInvoiceId?: string | null | undefined; convertedToInvoiceNumber?: string | null | undefined; }, Error, { id: string; input?: ConvertProformaInput; }, unknown>; render: import("@tanstack/react-query").UseMutationResult<{ [x: string]: unknown; id: string; }, Error, { id: string; input?: RenderInvoiceInput; }, unknown>; update: import("@tanstack/react-query").UseMutationResult<{ [x: string]: unknown; id: string; invoiceNumber: string; bookingId: string; personId: string | null; organizationId: string | null; status: "paid" | "void" | "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "overdue"; currency: string; subtotalCents: number; taxCents: number; totalCents: number; paidCents: number; balanceDueCents: number; issueDate: string; dueDate: string; notes: string | null; createdAt: string; updatedAt: string; invoiceType?: "invoice" | "proforma" | "credit_note" | undefined; voidedAt?: string | null | undefined; voidReason?: string | null | undefined; bookingPaymentScheduleIds?: string[] | undefined; convertedToInvoiceId?: string | null | undefined; convertedToInvoiceNumber?: string | null | undefined; }, Error, { id: string; input: UpdateInvoiceInput; }, unknown>; remove: import("@tanstack/react-query").UseMutationResult<{ success: boolean; }, Error, string, unknown>; voidInvoice: import("@tanstack/react-query").UseMutationResult<{ [x: string]: unknown; id: string; invoiceNumber: string; bookingId: string; personId: string | null; organizationId: string | null; status: "paid" | "void" | "draft" | "pending_external_allocation" | "issued" | "partially_paid" | "overdue"; currency: string; subtotalCents: number; taxCents: number; totalCents: number; paidCents: number; balanceDueCents: number; issueDate: string; dueDate: string; notes: string | null; createdAt: string; updatedAt: string; invoiceType?: "invoice" | "proforma" | "credit_note" | undefined; voidedAt?: string | null | undefined; voidReason?: string | null | undefined; bookingPaymentScheduleIds?: string[] | undefined; convertedToInvoiceId?: string | null | undefined; convertedToInvoiceNumber?: string | null | undefined; }, Error, { id: string; input?: VoidInvoiceInput; }, unknown>; }; export interface ConvertProformaInput { /** Optional override; server derives from the proforma number when omitted. */ invoiceNumber?: string; issueDate?: string; dueDate?: string; } export interface CreateInvoiceFromBookingInput { bookingId: string; bookingPaymentScheduleId?: string; invoiceNumber?: string; issueDate: string; dueDate: string; notes?: string | null; currency?: string; baseCurrency?: string; fxRateSetId?: string; subtotalCents?: number; taxCents?: number; totalCents?: number; lineItems?: CreateInvoiceFromBookingLineItemInput[]; externalRefs?: CreateInvoiceFromBookingExternalRefInput[]; /** Defaults to `invoice` on the server. Pass `proforma` for placeholders. */ invoiceType?: "invoice" | "proforma"; /** * When `true`, downstream e-invoicing plugins (e.g. SmartBill) skip * the auto-sync triggered by `invoice.issued`. The event still fires * so other subscribers (ledgers, audit, etc.) see it. */ skipExternalSync?: boolean; } export interface CreateInvoiceFromBookingExternalRefInput { provider: string; externalId?: string | null; externalNumber?: string | null; externalUrl?: string | null; status?: string | null; metadata?: Record | null; syncedAt?: string | null; syncError?: string | null; } export interface CreateInvoiceFromBookingLineItemInput { description: string; quantity: number; unitAmountCents: number; taxRateBps?: number | null; taxAmountCents?: number | null; } export interface RenderInvoiceInput { format?: "pdf" | "html"; /** Optional invoice-template id; server falls back to the default. */ templateId?: string | null; }