* Extended functionalities

* Added different UIs
This commit is contained in:
2026-06-24 21:43:40 +02:00
parent 282f4864c4
commit f15bb7a916
348 changed files with 59057 additions and 498 deletions

View File

@@ -0,0 +1,59 @@
using System.ComponentModel.DataAnnotations;
namespace MealPlan.Api.DTOs.Recipe;
/// <summary>Payload for creating or updating a recipe with nested ingredients and steps.</summary>
public class CreateRecipeDto
{
[Required]
[MaxLength(255)]
public string Name { get; set; } = string.Empty;
/// <summary>0 = Breakfast, 1 = SecondBreakfast, 2 = Lunch, 3 = Dinner.</summary>
[Range(0, 3)]
public int MealCategory { get; set; }
[Range(0, 100000)]
public int? Calories { get; set; }
[Range(0, 10000)]
public decimal? Protein { get; set; }
[Range(0, 10000)]
public decimal? Fat { get; set; }
[Range(0, 10000)]
public decimal? Carbs { get; set; }
[Range(0, 100000)]
public int? PrepTimeMinutes { get; set; }
public List<CreateIngredientDto> Ingredients { get; set; } = new();
public List<CreateRecipeStepDto> Steps { get; set; } = new();
}
public class CreateIngredientDto
{
[Required]
[MaxLength(255)]
public string Name { get; set; } = string.Empty;
[Range(0, 100000)]
public decimal? AmountGrams { get; set; }
[MaxLength(50)]
public string? Unit { get; set; }
public int? CatalogItemId { get; set; }
public int SortOrder { get; set; }
}
public class CreateRecipeStepDto
{
[Range(1, 1000)]
public int StepNumber { get; set; }
[Required]
public string Description { get; set; } = string.Empty;
}

View File

@@ -23,6 +23,7 @@ public class IngredientDto
public decimal? AmountGrams { get; set; }
public string? Unit { get; set; }
public int SortOrder { get; set; }
public int? CatalogItemId { get; set; }
}
public class RecipeStepDto

View File

@@ -0,0 +1,10 @@
namespace MealPlan.Api.DTOs.Recipe;
/// <summary>Summary returned after an Excel import operation.</summary>
public class RecipeImportResultDto
{
public int CreatedCount { get; set; }
public int SkippedCount { get; set; }
public List<string> Errors { get; set; } = new();
public List<int> CreatedRecipeIds { get; set; } = new();
}

View File

@@ -0,0 +1,10 @@
namespace MealPlan.Api.DTOs.Recipe;
public class RecipeMacroRecalcResultDto
{
public int RecipesProcessed { get; init; }
public int RecipesUpdated { get; init; }
public int UnlinkedIngredientRows { get; init; }
}