#pragma once

#include <maps/wikimap/mapspro/libs/controller/include/basecontroller.h>
#include <maps/wikimap/mapspro/libs/flat_range/include/distribution.h>

#include <string>
#include <vector>

namespace maps::wiki {

class DistributeFlats;
template<> struct controller::ResultType<DistributeFlats>
{
    std::vector<flat_range::LevelWithFlats> levelsWithFlats;
    std::string warning;
    std::string error;
};

class DistributeFlats: public controller::BaseController<DistributeFlats>
{
public:
    struct Request
    {
        std::string dump() const;

        std::string body;
    };

    explicit DistributeFlats(const Request& request);

    virtual ~DistributeFlats() {}

    static const std::string& taskName();
    virtual std::string printRequest() const;

protected:
    virtual void control();

private:
    Request request_;
};

} // namespace maps::wiki
