// meet.cpp
#include "meet.hpp"
#include "src/vote.cpp"
#include "src/createmeet.cpp"
#include "src/authmeet.cpp"
#include "src/declmeet.cpp"
#include "src/restartmeet.cpp"
#include "src/closemeet.cpp"
#include "src/newgdecision.cpp"

#include <optional>

std::optional<Meet::meet> meet::get_meet(eosio::name coopname, const checksum256 &hash) {
    Meet::meets_index genmeets(_meet, coopname.value);
    auto hash_index = genmeets.get_index<"byhash"_n>();

    auto itr = hash_index.find(hash);
    if (itr == hash_index.end()) {
        return std::nullopt;
    }

    return *itr;
}
