#pragma once // Spec: models.md ProjectDetail. platforms and forked_from are not decoded. #include #include #include "core/Json.hpp" #include "model/Attachment.hpp" #include "model/Comment.hpp" #include "model/Project.hpp" #include "model/Reactions.hpp" #include "model/User.hpp" #include "model/Vote.hpp" namespace dp { struct ProjectDetail { Project::Data project; User author; bool isOwner = false; std::int64_t starCount = 0; Vote myVote; std::vector comments; std::vector attachments; bool bookmarked = false; bool isPrivate = false; bool readOnly = false; std::int64_t forkCount = 0; std::int64_t fileCount = 0; Reactions reactions; static ProjectDetail fromJson(const Json& j); std::string id() const { return "project:" + project.id; } }; } // namespace dp