journal/Journal.Core/Models/Conversation.cs
Jacob Schmidt 0d77300c22 feat: Project Journal backend monorepo
Monorepo with centralized build props, npm workspaces, LlamaSharp AI,
SQLite/SQLCipher storage, Svelte frontend, and unified smoke tests.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-03-02 20:56:26 -06:00

34 lines
979 B
C#

namespace Journal.Core.Models;
public class Conversation
{
public Guid Id { get; }
public string Title { get; set; }
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
public Conversation(string title)
{
if (string.IsNullOrWhiteSpace(title))
throw new ArgumentException("Title is required", nameof(title));
Id = Guid.NewGuid();
Title = title.Trim();
CreatedAt = DateTimeOffset.Now;
UpdatedAt = CreatedAt;
}
public Conversation(Guid id, string title, DateTimeOffset createdAt, DateTimeOffset updatedAt)
{
if (id == Guid.Empty)
throw new ArgumentException("Id is required", nameof(id));
if (string.IsNullOrWhiteSpace(title))
throw new ArgumentException("Title is required", nameof(title));
Id = id;
Title = title.Trim();
CreatedAt = createdAt;
UpdatedAt = updatedAt;
}
}