Jacob Schmidt d0fac4199a Initial commit: Journal.Core library + Sidecar console app
- 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>
2026-02-21 02:01:00 -06:00

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;
}
}