#pragma once #include #include #include struct User { std::string id; std::string username; std::string display_name; std::string password_hash; std::string created_at; }; struct Chat { std::string id; std::string title; std::vector member_ids; std::string created_at; }; struct Message { std::string id; std::string chat_id; std::string sender_id; std::string text; std::string created_at; std::vector attachment_ids; }; struct MessagePage { std::vector items; std::optional next_cursor; }; struct ChatPage { std::vector items; std::optional next_cursor; }; // Lab4: variants stay empty ([]); lab5 fills thumbnail/crop/optimized. struct Variant { std::string name; std::string content_type; int size_bytes = 0; std::string sha256; }; struct Attachment { std::string id; std::string chat_id; std::string owner_id; std::string filename; std::string content_type; int size_bytes = 0; std::string sha256; std::string status; // lab4: "ready" std::vector variants; // lab4: always empty std::optional error_code; std::string s3_key; // internal; never exposed in API JSON std::string created_at; std::string updated_at; }; // Track 1: pending presigned PUT session (not a public attachment until complete). struct DirectUpload { std::string id; std::string chat_id; std::string owner_id; std::string filename; std::string content_type; int expected_size = 0; std::string expected_sha256; std::string s3_key; // final key: attachments/{chat}/{id} std::string staging_key; // presigned PUT target: staging/{chat}/{id} std::string status; // pending|completed|aborted|expired bool overdue = false; // pending && expires_at < now(); not a column std::optional attachment_id; std::string expires_at; // RFC3339 for JSON long long expires_at_epoch = 0; // for INSERT std::string created_at; std::string updated_at; };