chore: init project
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using InboxIntel.Application.Common;
|
||||
using InboxIntel.Application.DTOs;
|
||||
using InboxIntel.Domain.Enums;
|
||||
|
||||
namespace InboxIntel.Application.Abstractions;
|
||||
|
||||
/// <summary>Orchestrates full + incremental Gmail sync, with resume support.</summary>
|
||||
public interface ISyncService
|
||||
{
|
||||
Task RunFullSyncAsync(Guid userId, CancellationToken ct = default);
|
||||
Task RunIncrementalSyncAsync(Guid userId, CancellationToken ct = default);
|
||||
Task<SyncStatus> GetStatusAsync(Guid userId, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
public interface IAnalyticsService
|
||||
{
|
||||
Task<DashboardSummaryDto> GetDashboardAsync(Guid userId, CancellationToken ct = default);
|
||||
Task<InboxHealthDto> GetInboxHealthAsync(Guid userId, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<SenderStatDto>> GetTopSendersAsync(Guid userId, int take = 20, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<TimeSeriesPointDto>> GetVolumeOverTimeAsync(Guid userId, int days = 90, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<HeatmapCellDto>> GetHeatmapAsync(Guid userId, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<AttachmentBreakdownDto>> GetAttachmentBreakdownAsync(Guid userId, CancellationToken ct = default);
|
||||
Task RefreshAggregatesAsync(Guid userId, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
public interface ISearchService
|
||||
{
|
||||
Task<PagedResult<EmailSummaryDto>> SearchAsync(Guid userId, SearchRequestDto request, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
public interface ICleanupService
|
||||
{
|
||||
Task<CleanupPreviewDto> PreviewAsync(Guid userId, CleanupRequestDto request, CancellationToken ct = default);
|
||||
Task<Result<CleanupResultDto>> ExecuteAsync(Guid userId, CleanupRequestDto request, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
public interface IUnsubscribeService
|
||||
{
|
||||
Task<IReadOnlyList<UnsubscribeItemDto>> GetSafeToUnsubscribeAsync(Guid userId, CancellationToken ct = default);
|
||||
Task DetectAsync(Guid userId, CancellationToken ct = default);
|
||||
Task<Result<CleanupResultDto>> ProcessQueueAsync(Guid userId, UnsubscribeRequestDto request, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AI layer. May be disabled, local (Ollama) or cloud (OpenAI). Per the
|
||||
/// safety rules, AI NEVER executes destructive actions - it only suggests.
|
||||
/// </summary>
|
||||
public interface IAiService
|
||||
{
|
||||
bool IsEnabled { get; }
|
||||
Task<AiClassificationDto> ClassifyAsync(Guid userId, Guid emailId, CancellationToken ct = default);
|
||||
Task<InboxSummaryDto> SummarizeInboxAsync(Guid userId, CancellationToken ct = default);
|
||||
Task<IReadOnlyList<AiCleanupSuggestionDto>> SuggestCleanupAsync(Guid userId, CancellationToken ct = default);
|
||||
Task<GeneratedQueryDto> GenerateQueryAsync(Guid userId, string naturalLanguage, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
/// <summary>Low-level chat completion abstraction implemented by Ollama / OpenAI providers.</summary>
|
||||
public interface IAiProvider
|
||||
{
|
||||
AiProviderMode Mode { get; }
|
||||
Task<string> CompleteAsync(string systemPrompt, string userPrompt, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
public enum ExportFormat { Pdf, Csv, Json }
|
||||
|
||||
public interface IExportService
|
||||
{
|
||||
Task<(byte[] Content, string ContentType, string FileName)> ExportReportAsync(Guid userId, ExportFormat format, CancellationToken ct = default);
|
||||
}
|
||||
Reference in New Issue
Block a user