use sqlx::PgPool;
use uuid::Uuid;
use anyhow::Result;

// TODO: Define Plugin struct (id, server_id, name, version, author, is_enabled, config_json, wipe_on_map, wipe_on_bp, created_at, updated_at)

/// Insert or update a plugin record (upsert by server_id + name).
pub async fn upsert_plugin(pool: &PgPool, server_id: Uuid, name: &str, version: &str, author: Option<&str>) -> Result<Uuid> {
    todo!()
}

/// Get all plugins for a server.
pub async fn get_plugins(pool: &PgPool, server_id: Uuid) -> Result<()> {
    todo!()
}

/// Update the JSON configuration blob for a plugin.
pub async fn update_plugin_config(pool: &PgPool, plugin_id: Uuid, config_json: &str) -> Result<()> {
    todo!()
}

/// Update wipe-related settings for a plugin (wipe on map, wipe on BP).
pub async fn update_plugin_wipe_settings(pool: &PgPool, plugin_id: Uuid, wipe_on_map: bool, wipe_on_bp: bool) -> Result<()> {
    todo!()
}

/// Remove a plugin record.
pub async fn delete_plugin(pool: &PgPool, plugin_id: Uuid) -> Result<()> {
    todo!()
}
