Feature: Save AI parsing notes with receipt

Store user-provided parsing notes in the database so they persist
across parsing attempts. Notes are displayed in Receipt Information
and pre-populated in the textarea for future parses.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 20:49:31 -05:00
parent c5fad34658
commit 865195ad16
7 changed files with 893 additions and 126 deletions

View File

@@ -39,6 +39,9 @@ namespace MoneyMap.Pages
[TempData]
public string? ErrorMessage { get; set; }
[BindProperty]
public string? ParsingNotes { get; set; }
public async Task<IActionResult> OnGetAsync(long id)
{
Receipt = await _db.Receipts
@@ -53,6 +56,9 @@ namespace MoneyMap.Pages
LineItems = Receipt.LineItems?.OrderBy(li => li.LineNumber).ToList() ?? new();
ParseLogs = Receipt.ParseLogs?.OrderByDescending(pl => pl.StartedAtUtc).ToList() ?? new();
// Load saved parsing notes
ParsingNotes = Receipt.ParsingNotes;
// Get receipt URL for display - use handler parameter
ReceiptUrl = $"/ViewReceipt/{id}?handler=file";
@@ -98,8 +104,8 @@ namespace MoneyMap.Pages
return RedirectToPage(new { id });
}
// Use the configured model from settings
var result = await selectedParser.ParseReceiptAsync(id, SelectedModel);
// Use the configured model from settings, pass user notes
var result = await selectedParser.ParseReceiptAsync(id, SelectedModel, ParsingNotes);
if (result.IsSuccess)
{