- Add Rust shutdown command that kills sidecar and exits app cleanly
- Frontend calls invoke('shutdown') after vault flush on close
- Add auth.ts, entries.ts, and normalize.ts backend modules
- Add EditorPanel.svelte component
- Expand entries store with full CRUD support
- Add JournalEntryDtos and JournalEntryDtoMapper in Journal.Core
- Update entry search, fragments, and sidecar CLI
Co-Authored-By: Oz <oz-agent@warp.dev>
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using Journal.Core.Dtos;
|
|
using Journal.Core.Models;
|
|
|
|
namespace Journal.Core.Services.Entries;
|
|
|
|
internal static class JournalEntryDtoMapper
|
|
{
|
|
public static JournalEntryDto ToDto(this JournalEntry entry)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(entry);
|
|
|
|
return new JournalEntryDto(
|
|
Date: entry.Date,
|
|
Fragments:
|
|
[
|
|
.. entry.Fragments.Select(fragment => new FragmentDto(
|
|
Id: fragment.Id,
|
|
Type: fragment.Type,
|
|
Description: fragment.Description,
|
|
Time: fragment.Time,
|
|
Tags: [.. fragment.Tags]))
|
|
],
|
|
RawContent: entry.RawContent,
|
|
Sections: entry.Sections.ToDictionary(
|
|
section => section.Key,
|
|
section => new ParsedSectionDto(
|
|
Title: section.Value.Title,
|
|
Content: [.. section.Value.Content],
|
|
Checkboxes: section.Value.Checkboxes.ToDictionary(checkbox => checkbox.Key, checkbox => checkbox.Value)),
|
|
StringComparer.Ordinal));
|
|
}
|
|
}
|