#pragma once // Spec: models.md Notification. Wire wrapper: notification, actor?. Data.type is a wire string mapped to // NotificationType, unknown values give nullopt. #include #include #include "core/Date.hpp" #include "core/Json.hpp" #include "model/NotificationType.hpp" #include "model/User.hpp" namespace dp { struct Notification { struct Data { std::string id; std::optional type; std::string message; bool read = false; std::string relatedId; std::string targetUrl; Date createdAt{}; static Data fromJson(const Json& j); }; Data data; std::optional actor; static Notification fromJson(const Json& j); std::string id() const { return "notification:" + data.id; } }; } // namespace dp