#pragma once

#include <maps/wikimap/mapspro/services/mrc/eye/lib/generate_hypothesis/include/config.h>
#include <maps/wikimap/mapspro/services/mrc/eye/lib/generate_hypothesis/include/generator.h>

#include <maps/wikimap/mapspro/services/mrc/eye/lib/generate_wrong_parking/include/metadata.h>

#include <maps/wikimap/mapspro/services/mrc/libs/db/include/eye/object_gateway.h>
#include <maps/wikimap/mapspro/services/mrc/libs/db/include/eye/hypothesis_gateway.h>

namespace maps::mrc::eye {

using WrongParkingGeneratorConfig = HypothesisGeneratorConfig;

struct WrongParkingGeneratorImpl {
    static bool appliesToObject(const db::eye::Object& object);

    static bool hasDuplicate(
        pqxx::transaction_base& txn,
        const db::eye::Hypothesis& hypothesis,
        db::TId objectId);

    static db::eye::Hypotheses validate(
        const db::eye::Object& object,
        const db::eye::ObjectLocation& location,
        const db::eye::Objects& slaveObjects,
        object::Loader& loader);
};

using WrongParkingGenerator
    = BaseHypothesisGenerator<
        WrongParkingGeneratorImpl,
        wrongParkingMetadata,
        db::eye::ObjectType::Sign,
        common::LockId::EyeGenerateWrongParking>;

} // namespace maps::mrc::eye
