feat(ui): INotesApi wrapper for daily notes
This commit is contained in:
@@ -4,6 +4,7 @@ using ClaudeDo.Data.Git;
|
||||
using ClaudeDo.Releases;
|
||||
using ClaudeDo.Ui;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
using ClaudeDo.Ui.ViewModels;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
@@ -100,6 +101,7 @@ sealed class Program
|
||||
sc.AddTransient<WorktreesOverviewModalViewModel>();
|
||||
sc.AddTransient<Func<WorktreesOverviewModalViewModel>>(sp => () => sp.GetRequiredService<WorktreesOverviewModalViewModel>());
|
||||
sc.AddSingleton<IPrimeScheduleApi, WorkerPrimeScheduleApi>();
|
||||
sc.AddSingleton<INotesApi, WorkerNotesApi>();
|
||||
sc.AddTransient<PrimeClaudeTabViewModel>();
|
||||
sc.AddTransient<SettingsModalViewModel>();
|
||||
sc.AddTransient<MergeModalViewModel>();
|
||||
|
||||
11
src/ClaudeDo.Ui/Services/Interfaces/INotesApi.cs
Normal file
11
src/ClaudeDo.Ui/Services/Interfaces/INotesApi.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using ClaudeDo.Ui.Services;
|
||||
|
||||
namespace ClaudeDo.Ui.Services.Interfaces;
|
||||
|
||||
public interface INotesApi
|
||||
{
|
||||
Task<List<DailyNoteDto>> ListAsync(DateOnly day);
|
||||
Task<DailyNoteDto?> AddAsync(DateOnly day, string text);
|
||||
Task UpdateAsync(string id, string text);
|
||||
Task DeleteAsync(string id);
|
||||
}
|
||||
13
src/ClaudeDo.Ui/Services/WorkerNotesApi.cs
Normal file
13
src/ClaudeDo.Ui/Services/WorkerNotesApi.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using ClaudeDo.Ui.Services.Interfaces;
|
||||
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public sealed class WorkerNotesApi : INotesApi
|
||||
{
|
||||
private readonly WorkerClient _client;
|
||||
public WorkerNotesApi(WorkerClient client) => _client = client;
|
||||
public Task<List<DailyNoteDto>> ListAsync(DateOnly day) => _client.GetDailyNotesAsync(day);
|
||||
public Task<DailyNoteDto?> AddAsync(DateOnly day, string text) => _client.AddDailyNoteAsync(day, text);
|
||||
public Task UpdateAsync(string id, string text) => _client.UpdateDailyNoteAsync(id, text);
|
||||
public Task DeleteAsync(string id) => _client.DeleteDailyNoteAsync(id);
|
||||
}
|
||||
Reference in New Issue
Block a user