import { CreationOptional, DataTypes, FindOptions, InferAttributes, InferCreationAttributes } from 'sequelize'; import { TenantModel } from '../tenant-model'; import type { CustomerAddress, CustomerPreferences, CustomerShipping } from './types'; export declare const nextCustomerId: (size?: number) => string; export declare const nextInvoicePrefix: (size?: number) => string; export declare class Customer extends TenantModel, InferCreationAttributes> { id: CreationOptional; livemode: boolean; instance_did?: string; did: string; description: string; name: string; email: string; phone: string; address?: CustomerAddress; shipping?: CustomerShipping; balance?: string; token_balance?: Record; currency_id?: string; delinquent: boolean; discount_id?: string; metadata: Record; invoice_credit_balance?: any; invoice_prefix?: string; invoice_settings?: { custom_fields?: { name: string; value: string; }[]; default_payment_method?: string; footer?: string; }; next_invoice_sequence?: number; app_store_uuid?: string; google_play_uuid?: string; created_at: CreationOptional; updated_at: CreationOptional; last_sync_at?: number; preference?: CustomerPreferences; static readonly GENESIS_ATTRIBUTES: { id: { type: DataTypes.StringDataType; primaryKey: boolean; allowNull: boolean; defaultValue: (size?: number) => string; }; livemode: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; did: { type: DataTypes.StringDataType; allowNull: boolean; }; address: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; description: { type: DataTypes.StringDataType; allowNull: boolean; }; name: { type: DataTypes.StringDataType; allowNull: boolean; }; email: { type: DataTypes.StringDataType; allowNull: boolean; }; phone: { type: DataTypes.StringDataType; allowNull: boolean; }; shipping: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; balance: { type: DataTypes.StringDataType; defaultValue: string; }; currency_id: { type: DataTypes.StringDataType; allowNull: boolean; }; delinquent: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; discount_id: { type: DataTypes.StringDataType; allowNull: boolean; }; metadata: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; invoice_credit_balance: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; invoice_prefix: { type: DataTypes.StringDataType; allowNull: boolean; }; invoice_settings: { type: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; next_invoice_sequence: { type: DataTypes.NumberDataTypeConstructor; defaultValue: number; }; app_store_uuid: { type: DataTypes.StringDataType; allowNull: boolean; unique: boolean; }; google_play_uuid: { type: DataTypes.StringDataType; allowNull: boolean; unique: boolean; }; created_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; updated_at: { type: DataTypes.DateDataTypeConstructor; defaultValue: DataTypes.AbstractDataTypeConstructor; allowNull: boolean; }; }; getInvoiceNumber(): Promise; getSummary(livemode?: boolean): Promise<{ paid: any; due: any; refunded: any; }>; canMakeNewPurchase(excludedInvoiceId?: string): Promise; getBalanceToApply(currencyId: string, amount: string): string; decreaseTokenBalance(currencyId: string, amount: string, dryRun?: boolean): Promise<{ starting: Record; ending: { [x: string]: string; }; }>; increaseTokenBalance(currencyId: string, amount: string, dryRun?: boolean): Promise<{ starting: Record; ending: { [x: string]: string; }; }>; static initialize(sequelize: any): void; static associate(models: any): void; static findByPkOrDid(id: string, options?: FindOptions): Promise; static getInvoicePrefix(): string; static formatAddressFromUser(user: any, customer?: Customer): { country: any; state: any; city: any; line1: any; line2: any; postal_code: any; }; static formatAddressFromCustomer(customer: Customer): { country: string; province: string; city: string; line1: string; line2: string; postalCode: string; }; static formatUpdateAddress(address: CustomerAddress, customer: Customer): CustomerAddress; } export type TCustomer = InferAttributes;