#pragma once

#include "features/watermark/IWatermarkQueries.h"
#include "features/watermark/IWatermarkSettings.h"
#include "features/common/SettingsCache.h"
#include "application/contracts/IApplicationTick.h"

namespace ta::features::watermark
{
    class WatermarkFeature final : public IWatermarkQueries, public ta::application::IApplicationTick
    {
    public:
        explicit WatermarkFeature(IWatermarkSettings& settings) noexcept;

        void initialize();
        void on_application_tick() override;
        void reset_session() noexcept;

        [[nodiscard]] std::optional<WatermarkView> snapshot() const override;

    private:
        void publish_snapshot();

        IWatermarkSettings& settings_;
        ta::features::SettingsCache<WatermarkView> snapshot_cache_;
    };
}
