namespace PowderCoating.Application.Constants;

/// <summary>
/// Central constants for the Columbia Coatings catalog integration — config keys, platform-setting
/// keys, and the derived provenance/manufacturer/category values the mapper assigns. Kept in one
/// place so the API client, sync mapper, scheduled job, and purge logic all agree on the strings.
/// </summary>
public static class ColumbiaIntegrationConstants
{
    // ── Configuration keys (appsettings.json / environment) ───────────────
    /// <summary>API key — secret, lives in config not the platform-settings DB.</summary>
    public const string ConfigApiKey = "Columbia:ApiKey";
    public const string ConfigBaseUrl = "Columbia:BaseUrl";

    /// <summary>Configurable API namespace/base path, so an API version bump is a config change.</summary>
    public const string ConfigApiBasePath = "Columbia:ApiBasePath";

    public const string DefaultBaseUrl = "https://columbiacoatings.com";
    public const string DefaultApiBasePath = "/wp-json/cca/v1";

    /// <summary>Resource segment appended to the API base path for product endpoints.</summary>
    public const string ProductsResource = "/products";

    /// <summary>API caps per_page at 100.</summary>
    public const int MaxPerPage = 100;

    // ── Platform setting keys (SuperAdmin-managed, non-secret) ────────────
    public const string SettingEnabled = "ColumbiaSyncEnabled";
    public const string SettingIntervalDays = "ColumbiaSyncIntervalDays";
    public const string SettingLastSyncedAt = "ColumbiaLastSyncedAt";
    public const string SettingLastResult = "ColumbiaLastSyncResult";

    public const int DefaultSyncIntervalDays = 7;

    // ── Provenance ────────────────────────────────────────────────────────
    /// <summary>Stored in <c>PowderCatalogItem.Source</c> — the purge key for right-to-delete.</summary>
    public const string SourceName = "Columbia Coatings API";

    // ── Derived manufacturers (PowderCatalogItem.VendorName) ──────────────
    public const string ManufacturerColumbia = "Columbia Coatings";
    public const string ManufacturerPpg = "PPG";
    public const string ManufacturerKp = "KP Pigments";

    // ── Derived category (PowderCatalogItem.Category) ─────────────────────
    public const string CategoryPowderAdditives = "Powder Additives";
}
