refactor: extract Models and Data into MoneyMap.Core shared library

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-20 18:16:33 -04:00
parent d831991ad0
commit 3deca29f05
23 changed files with 59 additions and 7 deletions
+43
View File
@@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace MoneyMap.Models;
[Index(nameof(ReceiptId), nameof(StartedAtUtc))]
public class ReceiptParseLog
{
[Key]
public long Id { get; set; }
public long ReceiptId { get; set; }
public Receipt Receipt { get; set; } = null!;
// Provider metadata as strings for flexibility
[MaxLength(50)]
public string Provider { get; set; } = string.Empty; // e.g., "OpenAI", "Azure", "Google", "Tesseract"
[MaxLength(100)]
public string Model { get; set; } = string.Empty; // e.g., "gpt-4o-mini"
[MaxLength(100)]
public string? ProviderJobId { get; set; }
public DateTime StartedAtUtc { get; set; } = DateTime.UtcNow;
public DateTime? CompletedAtUtc { get; set; }
public bool Success { get; set; }
// ReceiptParseLog
[Column(TypeName = "decimal(5,4)")]
public decimal? Confidence { get; set; } // 0.00000.9999 is plenty
// Store full provider JSON payload for re-parsing/debug (keep out of hot paths)
public string RawProviderPayloadJson { get; set; } = "{}";
// Optional extracted text path if you persist a .txt alongside the image/PDF
[MaxLength(1024)]
public string? ExtractedTextPath { get; set; }
public string? Error { get; set; }
}