#pragma once // Spec: SPEC.md NFR-TEST-01. Realistic wire samples (shape of docs/inventory/models.md) shared by the tests. #include namespace dp::test { struct Samples { static std::string user(const std::string& id = "u1", const std::string& name = "alice") { return R"({"uid":")" + id + R"(","username":")" + name + R"(","avatar_seed":null,"role":"Member","bio":"hi","location":null,"git_link":"https://git.example/a","website":"",)" R"("level":3,"xp":120,"stars":7,"created_at":"2026-11-01T10:00:00Z","time_ago":"3 weeks ago"})"; } static std::string reactions() { return R"({"mine":["fire"],"counts":{"fire":2,"rocket":1}})"; } static std::string comment(const std::string& id, const std::string& children = "[]") { return R"({"comment":{"uid":")" + id + R"(","user_uid":"u1","content":"nice","parent_uid":null,"target_type":"post",)" R"("target_uid":"p1","created_at":"2026-11-29T08:00:00.250Z"},"author":)" + user() + R"(,"my_vote":1,"votes":{"up":3,"down":1},"attachments":[],"children":)" + children + R"(,"reactions":)" + reactions() + "}"; } static std::string attachment(const std::string& id = "a1") { return R"({"uid":")" + id + R"(","filename":"p.png","url":"https://x/p.png","size":12,"is_image":true,"is_video":false,)" R"("mime_type":"image/png","created_at":"2026-11-29T08:00:00Z","can_modify":false})"; } static std::string poll() { return R"({"uid":"poll1","question":"Q?","options":[{"uid":"o1","label":"A","count":3,"votes":null,"pct":75},)" R"({"uid":"o2","label":"B","count":1,"votes":1,"pct":25}],"total":4,"my_choice":"o1","voted":"o1"})"; } static std::string post(const std::string& id = "p1", bool withPoll = true) { return R"({"post":{"uid":")" + id + R"(","title":null,"topic":"devlog","content":"hello world post","slug":"hello-)" + id + R"(","user_uid":"u1","stars":5,"image":null,"created_at":"2026-11-29T08:00:00Z","updated_at":null},"author":)" + user() + R"(,"my_vote":-1,"comment_count":2,"recent_comments":[)" + comment("c1") + R"(],"bookmarked":true,"attachments":[)" + attachment() + "]," + (withPoll ? R"("poll":)" + poll() + "," : std::string()) + R"("reactions":)" + reactions() + "}"; } static std::string feed(const std::string& nextCursor = "\"2026-11-28T00:00:00Z\"") { return R"({"posts":[)" + post("p1") + "," + post("p2", false) + R"(],"current_tab":"all","current_topic":null,"search":"","next_cursor":)" + nextCursor + R"(,"total_members":10,"posts_today":2,"total_projects":3,"total_gists":4,"top_authors":[)" + user() + R"(],"daily_topic":null})"; } static std::string postDetail() { return R"({"post":{"uid":"p1","title":"T","topic":"fun","content":"c","slug":"s","user_uid":"u1","stars":1,"image":null,)" R"("created_at":"2026-11-29T08:00:00Z","updated_at":"2026-11-29T09:00:00+01:00"},"author":)" + user() + R"(,"is_owner":true,"star_count":9,"my_vote":1,"comments":[)" + comment("c1", "[" + comment("c2") + "]") + R"(],"attachments":[],"bookmarked":false,"poll":null,"comment_count":2,"related_posts":[],"topics":["a","b"],"reactions":)" + reactions() + "}"; } static std::string projectData(const std::string& id = "pr1") { return R"("uid":")" + id + R"(","slug":"proj","user_uid":"u1","title":"P","description":"d","project_type":"app","status":"active",)" R"("stars":4,"is_private":false,"read_only":null,"release_date":"2026-01-01","demo_date":null,)" R"("created_at":"2026-11-01T00:00:00Z","updated_at":null)"; } static std::string gist() { return R"({"gist":{"uid":"g1","slug":"gs","user_uid":"u1","title":"G","description":"d","source_code":"x","language":"cpp",)" R"("stars":2,"created_at":"2026-11-01T00:00:00Z","updated_at":null},"author":null,"my_vote":0,"comment_count":0,"recent_comments":[]})"; } static std::string articleData() { return R"({"uid":"ar1","slug":"s","title":"T","description":"d","content":"c","url":"https://n/1","source_name":"N","author":"X",)" R"("grade":3,"ai_grade":4,"status":"ok","image_url":"https://i","featured":1,"has_unique_image":0,)" R"("article_published":"Sat, 29 Nov 2026 08:00:00 GMT","created_at":"2026-11-29T08:00:00Z","synced_at":"2026-11-29T08:05:00Z"})"; } static std::string profile() { return R"({"profile_user":)" + user() + R"(,"posts":[)" + post() + R"(],"badges":[{"name":"B","icon":null,"created_at":"2026-11-01T00:00:00Z"}],)" R"("badge_total":10,"badge_earned":1,"projects":[{)" + projectData() + R"(}],"gists":[)" + gist() + R"(],"current_tab":"posts","posts_count":1,"is_following":false,"is_blocked":false,"is_muted":false,"is_owner":true,)" R"("can_view_api_key":true,"api_key":"k","ai_correction_enabled":false,"ai_correction_sync":false,"ai_correction_prompt":null,)" R"("ai_modifier_enabled":true,"ai_modifier_sync":false,"ai_modifier_prompt":"p","telegram_paired":false,"notif_telegram_paired":false,)" R"("can_manage_customization":true,"cust_disable_global":false,"cust_disable_pagetype":false,"xp_progress_pct":null,"rank":2,)" R"("followers_count":5,"following_count":6,"viewer_is_admin":false,"media":[{"uid":"m1","original_filename":"a.png","file_size":9,)" R"("mime_type":"image/png","url":"u","thumbnail_url":"t","has_thumbnail":true,"is_image":true,"is_video":false,)" R"("target_type":"post","target_uid":"p1","target_url":"/posts/s","created_at":"2026-11-01T00:00:00Z"}],)" R"("achievements":[{}],"ai_quota":{},"heatmap":null})"; } static std::string inbox() { return R"({"conversations":[{"other_user":)" + user("u2", "bob") + R"(,"last_message":"yo","last_message_at":"2026-11-29T07:00:00Z","unread":true}],"messages":[{"message":{"uid":"m1",)" R"("sender_uid":"u2","receiver_uid":"u1","content":"hey","read":false,"created_at":"2026-11-29T07:00:00Z"},"sender":)" + user("u2", "bob") + R"(,"is_mine":false,"attachments":[]}],"other_user":)" + user("u2", "bob") + R"(,"current_conversation":"c1","search":"","other_online":true,"other_last_seen":"just now"})"; } static std::string notifications() { return R"({"notification_groups":[{"label":"Today","entries":[{"notification":{"uid":"n1","type":"comment","message":"m","read":false,)" R"("related_uid":"c1","target_url":"/posts/s","created_at":"2026-11-29T08:00:00Z"},"actor":)" + user() + R"(},{"notification":{"uid":"n2","type":"unknown-type","message":"m2","read":true,"related_uid":"x","target_url":"/",)" R"("created_at":"2026-11-29T08:00:00Z"},"actor":null}]}],"next_cursor":null})"; } static std::string authToken(int expiresIn = 7200) { return R"({"token_type":"bearer","access_token":"tok-abc","expires_in":)" + std::to_string(expiresIn) + "}"; } }; } // namespace dp::test