#pragma once

#include <cstdint>
#include <string>
#include <unordered_map>

namespace ta::application
{
    inline constexpr std::uint32_t current_config_schema_version = 3;

    enum class ConfigStateLoadStatus
    {
        Loaded,
        Missing,
        Failed
    };

    struct ConfigApplicationState
    {
        std::uint32_t schema_version = current_config_schema_version;
        int menu_key = 0;
        std::string language_id;
        std::unordered_map<std::string, std::string> values;
    };

    struct ConfigStateLoadResult
    {
        ConfigStateLoadStatus status = ConfigStateLoadStatus::Failed;
        ConfigApplicationState state{};
    };

    class IConfigPersistence
    {
    public:
        virtual ~IConfigPersistence() = default;
        [[nodiscard]] virtual ConfigStateLoadResult load_state() const = 0;
        [[nodiscard]] virtual bool save_state(const ConfigApplicationState& state) const = 0;
    };
}
