3deca29f05
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
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; }
|
||
}
|