Implement Phase 2: end-to-end import system
Complete the import flow from file upload through duplicate resolution to transaction creation. Previously, ResolveDuplicatesAsync was a stub that only incremented counters, FileWatcherService detected files but didn't process them, and ImportsView.vue ignored the API response. Backend: - Add ParsedDataJson column to ImportBatch to persist parsed data between upload and confirm steps - Rewrite ImportService.ResolveDuplicatesAsync to deserialize parsed transactions and create/merge/skip based on user decisions, with payee matching, fingerprinting, and account balance updates - Add GetBatchesAsync for import history - Complete FileWatcherService: wait for file ready, resolve account by filename, call UploadAsync, send SignalR notification, archive file - Add GET /api/imports/batches endpoint Frontend: - Create imports API service (frontend/src/services/imports.ts) - Add ImportBatch, DuplicateResolution types - Rewrite ImportsView.vue with 3-step Vuetify stepper wizard: upload, review with duplicate handling, completion summary, plus import history table Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,17 +6,21 @@ public interface IImportService
|
||||
{
|
||||
Task<ImportUploadResponse> UploadAsync(Guid userId, Guid accountId, string fileName, Stream fileStream);
|
||||
Task<ImportBatchResponse> ConfirmBatchAsync(Guid userId, Guid batchId);
|
||||
Task ResolveDuplicatesAsync(Guid userId, Guid batchId, ResolveDuplicatesRequest request);
|
||||
Task<ImportBatchResponse> ResolveDuplicatesAsync(Guid userId, Guid batchId, ResolveDuplicatesRequest request);
|
||||
Task<List<ImportBatchResponse>> GetBatchesAsync(Guid userId);
|
||||
}
|
||||
|
||||
public record ImportBatchResponse(
|
||||
Guid Id,
|
||||
Guid AccountId,
|
||||
string AccountName,
|
||||
string FileName,
|
||||
string FileType,
|
||||
int TotalCount,
|
||||
int ImportedCount,
|
||||
int DuplicateCount,
|
||||
int SkippedCount,
|
||||
int MergedCount,
|
||||
string Status,
|
||||
DateTime ImportedAt
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ public class ImportBatch
|
||||
public int DuplicateCount { get; set; }
|
||||
public int SkippedCount { get; set; }
|
||||
public ImportStatus Status { get; set; } = ImportStatus.Pending;
|
||||
public string? ParsedDataJson { get; set; }
|
||||
public DateTime ImportedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public User User { get; set; } = null!;
|
||||
|
||||
Reference in New Issue
Block a user