using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace MealPlan.Api.Models; /// /// Maps to the existing "Recipes" table. Database-first; no migrations manage this table. /// [Table("Recipes")] public class Recipe { [Column("Id")] public int Id { get; set; } [Column("Name")] [MaxLength(255)] public string Name { get; set; } = string.Empty; /// Stored as INT in the DB (0..3). Mapped to the enum. [Column("MealCategory")] public int MealCategory { get; set; } [Column("Calories")] public int? Calories { get; set; } [Column("Protein")] public decimal? Protein { get; set; } [Column("Fat")] public decimal? Fat { get; set; } [Column("Carbs")] public decimal? Carbs { get; set; } [Column("PrepTimeMinutes")] public int? PrepTimeMinutes { get; set; } [Column("CreatedAt")] public DateTime CreatedAt { get; set; } [Column("UpdatedAt")] public DateTime? UpdatedAt { get; set; } [Column("IsActive")] public bool IsActive { get; set; } [Column("Source")] [MaxLength(32)] public string Source { get; set; } = "manual"; [Column("CreatedByUserId")] public Guid? CreatedByUserId { get; set; } [Column("IsDraft")] public bool IsDraft { get; set; } public ICollection Ingredients { get; set; } = new List(); public ICollection Steps { get; set; } = new List(); }