// Branch-related TypeScript interfaces

export interface Branch {
    id: number;
    code: string;
    name: string;
    address: string | null;
    city: string | null;
    province: string | null;
    phone: string | null;
    email: string | null;
    is_headquarters: boolean;
    is_active: boolean;
    created_at: string | null;
    updated_at: string | null;
    deleted_at: string | null;

    // Dependency counts (for delete validation)
    members_count?: number;
    savings_count?: number;
    financings_count?: number;
    users_count?: number;
}

export interface BranchFilters {
    search?: string;
    is_active?: string;
    is_headquarters?: string;
}

export interface BranchFormData {
    code: string;
    name: string;
    address: string | null;
    city: string | null;
    province: string | null;
    phone: string | null;
    email: string | null;
    is_headquarters: boolean;
    is_active: boolean;
}

export interface BranchSummary {
    members: {
        total: number;
        active: number;
    };
    savings: {
        total_accounts: number;
        total_balance: number;
        active_accounts: number;
    };
    financing: {
        total_financings: number;
        total_balance: number;
        active_financings: number;
        overdue_count: number;
    };
    users: {
        total: number;
        active: number;
    };
}

export interface BranchShowProps {
    branch: Branch;
    summary: BranchSummary;
}
