using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace LittleShop.Models; public class OrderItem { [Key] public Guid Id { get; set; } public Guid OrderId { get; set; } public Guid ProductId { get; set; } public Guid? ProductVariationId { get; set; } // Nullable for backward compatibility public int Quantity { get; set; } [Column(TypeName = "decimal(18,2)")] public decimal UnitPrice { get; set; } [Column(TypeName = "decimal(18,2)")] public decimal TotalPrice { get; set; } // Navigation properties public virtual Order Order { get; set; } = null!; public virtual Product Product { get; set; } = null!; public virtual ProductVariation? ProductVariation { get; set; } }