use crate::repository::api::prelude::*;

/// Get the list of whitelisted IPs for the current user
pub async fn get_whitelist_ips(tg_id: i64, pool: PoolType) -> Result<Vec<String>> {
    let user_id = get_test_user_id(tg_id);
    rust_shared::repository::api::get_whitelist_ips(user_id, pool).await
}

/// Add an IP address to the whitelist
pub async fn add_ip_to_whitelist(tg_id: i64, ip: String, pool: PoolType) -> Result<String> {
    let user_id = get_test_user_id(tg_id);
    rust_shared::repository::api::add_ip_to_whitelist(user_id, ip, pool).await
}

/// Remove an IP address from the whitelist
pub async fn remove_ip_from_whitelist(tg_id: i64, ip: String, pool: PoolType) -> Result<String> {
    let user_id = get_test_user_id(tg_id);
    rust_shared::repository::api::remove_ip_from_whitelist(user_id, ip, pool).await
}

/// Validate IP address format
pub fn validate_ip_address(ip: &str) -> bool {
    rust_shared::repository::api::validate_ip_address(ip)
} 