toInsertJson method
Implementation
Map<String, dynamic> toInsertJson() {
return {
// Include `id` when supplied (outbox flow); empty id falls back to
// the server's `gen_random_uuid()` default for legacy callers that
// haven't migrated to client-supplied UUIDs yet.
if (id.isNotEmpty) 'id': id,
'user_id': userId,
'topic_id': topicId,
'session_id': sessionId,
'title': title,
'content': content,
'tags': tags,
'is_pinned': isPinned,
};
}