# SQ-001: Domain Types **Status:** `[x] DONE` **Blocked by:** SQ-000 **Priority:** High ## Description Define the core domain types in `sq-models`: Message, Header, TopicName, Offset, and configuration types. These are the foundational types used throughout the entire system. ## Files to Create/Modify - `crates/sq-models/src/lib.rs` - re-exports - `crates/sq-models/src/message.rs` - Message, Header, TopicName, Offset types - `crates/sq-models/src/config.rs` - TopicConfig, WalConfig ## Key Types ```rust pub struct Message { pub offset: u64, pub topic: TopicName, pub key: Option>, pub value: Vec, pub headers: Vec
, pub timestamp_ms: u64, } pub struct Header { pub key: String, pub value: Vec, } pub struct TopicName(pub String); pub struct WalConfig { pub max_segment_bytes: u64, // default 64MB pub max_segment_age_secs: u64, // default 60s pub data_dir: PathBuf, } pub struct TopicConfig { pub name: TopicName, pub partitions: u32, // default 1 pub replication_factor: u32, // default 3 } ``` ## Acceptance Criteria - [ ] All types compile and are public - [ ] `Message` implements `Clone`, `Debug`, `PartialEq` - [ ] Unit test: construct a Message, verify all fields - [ ] Property test (optional): arbitrary Message roundtrip through Debug/PartialEq