Create ViewModels for the Create Recipe logic

This commit is contained in:
franc
2025-05-05 12:19:27 +02:00
parent 0d57d40651
commit 080c4eda78
2 changed files with 51 additions and 0 deletions
@@ -0,0 +1,37 @@
using Francesco.Recipes.World.Models.BackendModels.Recipe;
namespace Francesco.Recipes.World.Models
{
public class CreateRecipeViewModel
{
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public Difficulty Difficulty { get; set; }
public int Servings { get; set; }
public TimeSpan PreparationTime { get; set; }
public TimeSpan CookingTime { get; set; }
public int PrepHours { get; set; }
public int PrepMinutes { get; set; }
public int CookHours { get; set; }
public int CookMinutes { get; set; }
public Guid CategoryId { get; set; }
public IFormFile? Photo { get; set; }
public IFormFile? Video { get; set; }
public IngredientViewModel? IngredientViewModel { get; set; }
public InstructionViewModel? InstructionViewModel { get; set; }
}
}
@@ -0,0 +1,14 @@
namespace Francesco.Recipes.World.Models
{
using Francesco.Recipes.World.Models.BackendModels.Ingredient;
using Francesco.Recipes.World.Models.BackendModels.Unit;
public class IngredientViewModel
{
public Guid RecipeId { get; set; }
public List<Ingredient> Ingredients { get; set; } = new List<Ingredient>();
public List<Unit> Units { get; set; } = new List<Unit>();
}
}