#pragma once

#include <cstddef>
#include <cstdint>
#include <string>
#include <type_traits>

#include "external/il2cpp/il2cpp-api-types.h"

namespace ta::adapters::eft::common
{
    struct EftMongoId
    {
        std::uint32_t timestamp = 0;
        std::uint64_t counter = 0;
        Il2CppString* string_id = nullptr;
    };

    static_assert(std::is_standard_layout_v<EftMongoId>);
    static_assert(sizeof(EftMongoId) == 24);
    static_assert(offsetof(EftMongoId, timestamp) == 0);
    static_assert(offsetof(EftMongoId, counter) == 8);
    static_assert(offsetof(EftMongoId, string_id) == 16);

    [[nodiscard]] std::string mongo_id_string(const EftMongoId& id);
    [[nodiscard]] bool same_mongo_id(const EftMongoId& left, const EftMongoId& right) noexcept;
}
