74 lines
2.8 KiB
C#
74 lines
2.8 KiB
C#
using UtopiaCanteenSystem.Models;
|
||
|
||
namespace UtopiaCanteenSystem.Services;
|
||
|
||
/// <summary>
|
||
/// Provides persisted configuration values for the app.
|
||
/// </summary>
|
||
public interface IConfigService
|
||
{
|
||
string GetSyncApiEndpoint();
|
||
void SetSyncApiEndpoint(string endpoint);
|
||
bool GetSyncServiceEnabled();
|
||
void SetSyncServiceEnabled(bool enabled);
|
||
bool GetScannerConnected();
|
||
void SetScannerConnected(bool connected);
|
||
/// <summary>Scan interval: minimum time between scans. Days (0–365), Hours (0–23), Minutes (0–59), Seconds (0–59).</summary>
|
||
int GetScanIntervalDays();
|
||
void SetScanIntervalDays(int value);
|
||
int GetScanIntervalHours();
|
||
void SetScanIntervalHours(int value);
|
||
int GetScanIntervalMinutes();
|
||
void SetScanIntervalMinutes(int value);
|
||
int GetScanIntervalSeconds();
|
||
void SetScanIntervalSeconds(int value);
|
||
/// <summary>Computed interval from D+H+M+S with clamping. If all zero, returns default (1 minute).</summary>
|
||
TimeSpan GetScanInterval();
|
||
string GetAdminCardId();
|
||
void SetAdminCardId(string cardId);
|
||
|
||
string GetSiteId();
|
||
void SetSiteId(string siteId);
|
||
/// <summary>Persist HRMS location_site_id in the same format as the scanner dashboard (digits → "SITE : …").</summary>
|
||
void ApplyLocationSiteIdFromAuth(string? locationSiteId);
|
||
string GetDeviceId();
|
||
void SetDeviceId(string deviceId);
|
||
|
||
bool GetRememberAdminCredentials();
|
||
void SetRememberAdminCredentials(bool remember);
|
||
string GetSavedAdminUsername();
|
||
void SetSavedAdminUsername(string username);
|
||
string GetSavedAdminPassword();
|
||
void SetSavedAdminPassword(string password);
|
||
|
||
string GetMySqlConnectionString();
|
||
void SetMySqlConnectionString(string connectionString);
|
||
|
||
/// <summary>
|
||
/// MySQL connection for HRMS/UIND (cache sync, employee lookup, lunch_order post).
|
||
/// Uses <c>HrmsLookupConnectionString</c> when set; otherwise <see cref="GetMySqlConnectionString"/>.
|
||
/// </summary>
|
||
string GetHrmsLookupConnectionString();
|
||
void SetHrmsLookupConnectionString(string connectionString);
|
||
|
||
DateTime? GetLastEmployeeRfidCacheSyncUtc();
|
||
void SetLastEmployeeRfidCacheSyncUtc(DateTime utc);
|
||
|
||
DateTime? GetLastMealMenuCacheSyncUtc();
|
||
void SetLastMealMenuCacheSyncUtc(DateTime utc);
|
||
|
||
AppMode GetAppMode();
|
||
void SetAppMode(AppMode mode);
|
||
|
||
/// <summary>Client mode: central server API base URL (e.g. http://192.168.1.10:5000).</summary>
|
||
string GetCentralServerBaseUrl();
|
||
void SetCentralServerBaseUrl(string url);
|
||
|
||
/// <summary>Backend API base URL for HTTP calls (client: remote server; server: http://localhost:port).</summary>
|
||
string GetBackendBaseUrl();
|
||
|
||
/// <summary>HttpListener bind URL(s) when <see cref="AppMode.Server"/> (e.g. http://0.0.0.0:5000).</summary>
|
||
string GetLocalServerListenUrls();
|
||
void SetLocalServerListenUrls(string urls);
|
||
}
|