using System.Collections.Generic;
using HC_APTBS.Models;
namespace HC_APTBS.Services
{
///
/// Provides read/write access to persisted application configuration.
/// Configuration files live under %UserProfile%\.HC_APTBS\config\.
///
public interface IConfigurationService
{
// ── Settings ──────────────────────────────────────────────────────────────
/// Application-wide settings (temperature limits, PID, refresh rates, etc.).
AppSettings Settings { get; }
/// Persists to config.xml.
void SaveSettings();
// ── Bench configuration ───────────────────────────────────────────────────
///
/// Current bench CAN parameter map and relay definitions.
/// Loaded from bench.xml on first access.
///
BenchConfiguration Bench { get; }
/// Persists to bench.xml.
void SaveBench();
// ── Pump database ─────────────────────────────────────────────────────────
/// Returns all known pump IDs from the pump database.
IReadOnlyList GetPumpIds();
///
/// Loads the full for the pump with the given ID,
/// including its CAN parameter map and test list.
///
PumpDefinition? LoadPump(string pumpId);
/// Persists a pump definition back to the database.
void SavePump(PumpDefinition pump);
// ── Clients ───────────────────────────────────────────────────────────────
/// Sorted client name → contact info dictionary.
SortedDictionary Clients { get; }
/// Persists the client list to clients.xml.
void SaveClients();
// ── Pump status definitions ───────────────────────────────────────────────
///
/// Loads the for the given status ID.
/// Definitions are cached after first load. Returns null if the ID is not found.
///
PumpStatusDefinition? LoadPumpStatus(int statusId);
// ── Sensors ───────────────────────────────────────────────────────────────
/// Saves updated sensor calibration data to sensors.xml.
void SaveSensors();
// ── Users ─────────────────────────────────────────────────────────────────
/// Validates a username/password pair against stored credentials.
bool ValidateUser(string username, string password);
/// Returns all stored user credentials as a dictionary.
IReadOnlyDictionary GetUsers();
/// Replaces all stored user credentials and persists them.
void UpdateUsers(Dictionary users);
}
}