#pragma once

#include <cstdint>
#include <string_view>
#include <vector>

#include "adapters/eft/items/catalog/CatalogRebuildJob.h"
#include "features/items/contracts/ItemCatalogTypes.h"

namespace ta::adapters::eft::items
{
    class ItemTemplateCatalogService final
    {
    public:
        void update();
        void request_reload() noexcept;

        [[nodiscard]] const std::vector<ta::features::items::contracts::ItemCatalogEntry>& entries() const noexcept;
        [[nodiscard]] ta::features::items::contracts::ItemCategory category_for(std::string_view template_id) const;
        [[nodiscard]] int max_stack_for(std::string_view template_id) const noexcept;
        [[nodiscard]] std::uint64_t revision() const noexcept;
        [[nodiscard]] bool loading() const noexcept;
        [[nodiscard]] bool ready() const noexcept;
        [[nodiscard]] CatalogPhase phase() const noexcept;

    private:
        CatalogRebuildJob rebuild_job_;
    };
}
