* Extended functionalities
* Added different UIs
This commit is contained in:
59
MealPlan.Api/DTOs/Recipe/CreateRecipeDto.cs
Normal file
59
MealPlan.Api/DTOs/Recipe/CreateRecipeDto.cs
Normal 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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
10
MealPlan.Api/DTOs/Recipe/RecipeImportResultDto.cs
Normal file
10
MealPlan.Api/DTOs/Recipe/RecipeImportResultDto.cs
Normal 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();
|
||||
}
|
||||
10
MealPlan.Api/DTOs/Recipe/RecipeMacroRecalcResultDto.cs
Normal file
10
MealPlan.Api/DTOs/Recipe/RecipeMacroRecalcResultDto.cs
Normal 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user