using System.ComponentModel.DataAnnotations; using LittleShop.Enums; namespace LittleShop.Models; public class ProductVariant { [Key] public Guid Id { get; set; } public Guid ProductId { get; set; } [Required] [StringLength(100)] public string Name { get; set; } = string.Empty; // e.g., "Red", "Blue", "Vanilla", "Chocolate" [StringLength(50)] public string VariantType { get; set; } = "Standard"; // e.g., "Color", "Flavor", "Size", "Standard" public int SortOrder { get; set; } = 0; // For controlling display order public bool IsActive { get; set; } = true; public int StockLevel { get; set; } = 0; // Optional: track stock per variant public decimal? Weight { get; set; } // Optional: override product weight for this variant public ProductWeightUnit? WeightUnit { get; set; } // Optional: override product weight unit for this variant public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; // Navigation properties public virtual Product Product { get; set; } = null!; }