import { AddressPayload } from '../../address/addressPayload'; import { InvoicingListCounts } from '../invoicingCommonPayload'; import { InvoicingSubscriptionPayload } from '../invoicingSubscription/invoicingSubscriptionPayload'; import { InvoicingCustomer } from './invoicingCustomerState'; /** * A single entry of the customer `payment_methods` array. Its field names * differ from the customer-level scalars (`last4` vs `payment_method_last4`), * so they are mapped independently. */ export interface InvoicingCustomerPaymentMethodPayload { payment_method_id: string; exp_month?: number; exp_year?: number; is_default?: boolean; last4?: string; payment_method_type?: string; } export interface InvoicingCustomerPayload { id: string; arr?: number; auto_collection?: 'on' | 'off'; billing_address?: AddressPayload | null; billing_address_id?: string; card_status?: 'no_card' | 'valid' | 'expiring' | 'expired'; company?: string; consolidated_invoicing?: boolean; created_at?: string; customer_type?: 'residential' | 'business'; default_payment_method_id?: string; email?: string; excess_payments?: number; first_name?: string; fraud_flag?: 'safe' | 'suspicious' | 'fraudulent'; initials?: string; invoice_notes?: string; is_at_risk?: boolean; last_name?: string; lifetime_value?: number; locale?: string; mrr?: number; net_term_days?: number; notes?: string; payment_method?: string; payment_method_exp_month?: number; payment_method_exp_year?: number; payment_method_last4?: string; payment_method_type?: 'ach' | 'card' | 'none'; payment_methods?: InvoicingCustomerPaymentMethodPayload[]; phone?: string; plan?: string; plan_name?: string; preferred_currency_code?: string; preferred_currency_symbol?: string; promotional_credits?: number; refundable_credits?: number; status?: string; stripe_customer_id?: string; subscriptions?: InvoicingSubscriptionPayload[]; taxability?: 'taxable' | 'exempt'; total_receivable?: number; unbilled_charges?: number; updated_at?: string; vat_number?: string; } export interface InvoicingCustomerCounts extends InvoicingListCounts { active: number; at_risk: number; churned: number; not_churned: number; total: number; trial: number; } /** * Collect the embedded billing addresses from customer payloads so they can be * pushed into the shared address store (`updateAddresses`), while the customer * entity keeps only `billingAddressId` — mirrors the vendor flow. */ export declare const extractInvoicingCustomerAddresses: (payloads: InvoicingCustomerPayload[]) => AddressPayload[]; export declare const mapInvoicingCustomerPayloadToState: (payload: InvoicingCustomerPayload) => InvoicingCustomer;