Files
MoneyMap/MoneyMap.Core/Models/ReceiptLineItem.cs
T
2026-04-20 18:16:33 -04:00

44 lines
1.1 KiB
C#

using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace MoneyMap.Models;
[Index(nameof(ReceiptId), nameof(LineNumber))]
public class ReceiptLineItem
{
[Key]
public long Id { get; set; }
public long ReceiptId { get; set; }
public Receipt Receipt { get; set; } = null!;
public int LineNumber { get; set; }
[MaxLength(300)]
public string Description { get; set; } = string.Empty;
// ReceiptLineItem
[Column(TypeName = "decimal(18,4)")]
public decimal? Quantity { get; set; }
/// <summary>
/// Unit of Measure (ea, lb, gal, etc.)
/// </summary>
[MaxLength(16)]
public string? Unit { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal? UnitPrice { get; set; }
[Column(TypeName = "decimal(18,2)")]
public decimal? LineTotal { get; set; }
[MaxLength(64)]
public string? Sku { get; set; }
[MaxLength(100)]
public string? Category { get; set; }
public bool Voided { get; set; }
}