import { IContact } from './contact.types'; import { IOrganisation } from './organisation.types'; import { IPaginatedResults, JSONObject, Nullable } from './types'; export type CustomerType = Nullable; export type BusinessEntityType = Nullable; /** * Customer verification status type * - 'verified': Customer exists in the system (customer API returns valid data) * - 'not_verified': Customer does not exist in the system (customer API returns error, but token is valid - new customer flow) */ export type CustomerVerificationStatus = 'verified' | 'not_verified'; export type IAddress = { line1: string; line2: string; line3: string; city: string; state: string; zipCode: string; country: string; validation_status: string | null; }; export type ITaxConfig = { vat_id?: string; pan_number?: string; gstin?: string; }; export type IBusinessEntityBase = { name: string; address: IAddress; email: string; phone_number: string; is_default: boolean; tax_config: ITaxConfig | null; logo_url: string | null; }; export type IBusinessEntityResponse = { id: string; } & IBusinessEntityBase; export type IBusinessEntityPartialResponse = Pick; export type ICustomerAddress = { line1?: string; line2?: string; line3?: string; city?: string; state?: string; zipCode: string; country: string; validation_status?: AddressStatus; }; export declare enum AddressStatus { VALID = "valid", INVALID = "invalid", PENDING = "pending", PENDING_INPUT = "pending_input" } export type ICustomerTaxId = { tax_code: string; country_code: string; tax_id: string; is_verified?: boolean; is_default?: boolean; }; export type ICustomDataField = { label: string; value: string; }; export type ICustomerContact = { first_name: string; last_name: string; email: string; }; export type ICustomer = { id?: string; external_id?: string; customer_name?: string; email?: string; phone_number?: string; custom_data?: object; organisation?: string; address?: ICustomerAddress; ship_to_address?: ICustomerAddress; connector?: ICustomerConnector; contacts?: IContact[]; communications_enabled?: boolean; auto_charge_enabled?: boolean; tax_info?: ICustomerTaxId[]; created_at?: string; country_code?: string; business_entity?: IBusinessEntityResponse; business_entity_id?: string; }; export type ICustomerInput = { external_id?: string; email?: string; phone_number?: string; customer_name?: string; custom_data?: object; organisation?: string; address?: ICustomerAddress | null; ship_to_address?: ICustomerAddress | null; connector?: ICustomerConnector; contacts?: IContact[]; communications_enabled?: boolean; auto_charge_enabled?: boolean; tax_info?: ICustomerTaxId[]; country_code?: string; business_entity?: IBusinessEntityResponse | null; business_entity_id?: string | null; }; export type ICustomerList = { next: string; previous: string; results: ICustomer[]; }; export type ICustomerPortalRequest = { customer_id: string; return_url: string; idle_timeout?: number; }; export type ICustomerConnector = { id: string; email: string; customer_name: string; address: ICustomerAddress; reference_id: string; raw_data: IRawData; }; type IRawData = { id: string; name: string; email: string; phone: string; object: string; address: ICustomerAddress; balance: number; created: number; currency: string; discount: string; livemode: boolean; metadata: JSONObject; shipping: JSONObject; delinquent: boolean; tax_exempt: string; test_clock: string; description: string; default_source: string; invoice_prefix: string; default_currency: string; invoice_settings: { footer: string; custom_fields: string; rendering_options: string; default_payment_method: JSONObject; }; preferred_locales: string[]; next_invoice_sequence: number; }; export type WalletCalculationsProps = { isFetchingBalance: boolean; customerBalance: number; adjustedAmount: number; totalBalance: number; sidePanelCurrency: string; }; export type ICustomerRelationshipType = { id: string; name: string; inverse_name?: string; description?: string; cardinality: string; is_system_defined: boolean; created_at: string; updated_at: string; deleted_at?: string; }; export type ICustomerPaymentMethod = { id: string; customer_id: string; organisation_id: string; connector_id: string; connector_name: string; external_id: string; status: string; country: string; is_default: boolean; type: string; details: IPaymentMethodDetails; }; export type IPaymentMethodDetails = { account_holder_type?: string; account_type?: string; bank_name?: string; financial_connections_account?: any; fingerprint?: string; last4?: string; networks?: { preferred?: string; supported: string[]; }; routing_number?: string; status_details?: any; brand?: string; checks?: { address_line1_check?: string; address_postal_code_check?: string; cvc_check?: string; }; country?: string; display_brand?: string; exp_month?: number; exp_year?: number; funding?: string; generated_from?: any; three_d_secure_usage?: { supported: boolean; }; wallet?: any; description?: string; network?: string; network_token?: { used: boolean; }; }; export type ICustomerPaymentMethodsList = IPaginatedResults; export type ICustomerPortalValidatedSessionResponse = { id: string; customer: string; organisation: IOrganisation | string; is_guest_session: boolean; return_url?: string; expiration_time: string; created_at: string; }; export {};