#pragma once

#include <array>
#include <string>
#include <vector>

#include <fesa/core/diagnostic.hpp>
#include <fesa/core/status.hpp>
#include <fesa/model/ids.hpp>

namespace fesa {

struct NodalFrame final {
    std::vector<NodeId> node_ids;
    std::vector<std::array<double, 6>> displacement;
    std::vector<std::array<double, 6>> reaction;
};

struct ResultFrame final {
    double step_time;
    NodalFrame nodal;
    std::vector<Diagnostic> diagnostics;
};

struct ResultStep final {
    std::string name;
    std::vector<ResultFrame> frames;
};

struct ResultDatabase final {
    std::string schema_version;
    std::vector<ResultStep> steps;
};

[[nodiscard]] Status validate_result_database(
    const ResultDatabase& database);

}  // namespace fesa
