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:
@@ -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.0000–0.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; }
|
||||
}
|
||||
Reference in New Issue
Block a user