- Fragment model with validation, DTOs (immutable records), repository, service - Sidecar stdin/stdout JSON protocol for Tauri integration - DI wiring via ServiceCollectionExtensions - Scaffolded Journal.Api (not yet wired) Co-Authored-By: Warp <agent@warp.dev>
24 lines
723 B
C#
24 lines
723 B
C#
namespace Journal.Core.Models;
|
|
|
|
public class Fragment
|
|
{
|
|
public Guid Id { get; }
|
|
public string Type { get; set; }
|
|
public string Description { get; set; }
|
|
public DateTimeOffset Time { get; set; }
|
|
public List<string> Tags { get; set; } = [];
|
|
|
|
public Fragment(string type, string description)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(type))
|
|
throw new ArgumentException("Type is required", nameof(type));
|
|
if (string.IsNullOrWhiteSpace(description))
|
|
throw new ArgumentException("Description is required", nameof(description));
|
|
|
|
Id = Guid.NewGuid();
|
|
Type = type.Trim();
|
|
Description = description.Trim();
|
|
Time = DateTimeOffset.Now;
|
|
}
|
|
}
|