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? ProductMultiBuyId { get; set; } // Nullable for backward compatibility [StringLength(100)] public string? SelectedVariant { get; set; } // The variant chosen (e.g., "Red", "Vanilla") 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 ProductMultiBuy? ProductMultiBuy { get; set; } }