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>
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
namespace Journal.Core.Models;
|
|
|
|
public class ListDocument
|
|
{
|
|
public Guid Id { get; }
|
|
public string Label { get; set; }
|
|
public string Content { get; set; }
|
|
public DateTimeOffset CreatedAt { get; set; }
|
|
public DateTimeOffset UpdatedAt { get; set; }
|
|
|
|
public ListDocument(string label, string content = "")
|
|
{
|
|
Validate(label);
|
|
|
|
Id = Guid.NewGuid();
|
|
Label = label.Trim();
|
|
Content = content;
|
|
CreatedAt = DateTimeOffset.Now;
|
|
UpdatedAt = CreatedAt;
|
|
}
|
|
|
|
public ListDocument(Guid id, string label, string content, DateTimeOffset createdAt, DateTimeOffset updatedAt)
|
|
{
|
|
if (id == Guid.Empty)
|
|
throw new ArgumentException("Id is required", nameof(id));
|
|
Validate(label);
|
|
|
|
Id = id;
|
|
Label = label.Trim();
|
|
Content = content;
|
|
CreatedAt = createdAt;
|
|
UpdatedAt = updatedAt;
|
|
}
|
|
|
|
private static void Validate(string label)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(label))
|
|
throw new ArgumentException("Label is required", nameof(label));
|
|
}
|
|
}
|