From bc4af89c95ed54a1d32c87859087049572267555 Mon Sep 17 00:00:00 2001 From: Kevin Tran <112021023+kevbang@users.noreply.github.com> Date: Tue, 10 Mar 2026 01:03:13 -0500 Subject: [PATCH] Revert "feat: add recipe entities + refactor codebase" --- .../Pages/Assignments/AdminAssignTask.razor | 12 +- .../Components/Pages/EmployeeView.razor | 64 - .../Components/Pages/Recipes/Create.razor | 31 + .../Components/Pages/Recipes/Edit.razor | 33 + .../Components/Pages/Recipes/Index.razor | 5 + .../Components/Pages/Recipes/RecipeForm.razor | 234 ++++ .../Components/Pages/Recipes/RecipeList.razor | 167 +++ .../Components/Pages/Recipes/RecipeView.razor | 133 ++ .../Pages/Recipes/RecipeView.razor.css | 10 + .../LocationSettings/ConfigureLocation.razor | 152 --- CulinaryCommandApp/Data/AppDbContext.cs | 118 +- .../Data/Entities/Ingredient.cs | 26 + CulinaryCommandApp/Data/Entities/Location.cs | 8 +- .../Data/Entities/MeasurementUnit.cs | 24 + CulinaryCommandApp/Data/Entities/Recipe.cs | 37 + .../Data/Entities/RecipeIngredient.cs | 37 + .../Data/Entities/RecipeStep.cs | 25 + CulinaryCommandApp/Data/Entities/Tasks.cs | 5 +- .../Data/Models/MeasurementUnitViewModel.cs | 15 + .../Inventory/DTOs/CreateIngredientDTO.cs | 2 +- .../Inventory/DTOs/InventoryCatalogDTO.cs | 2 +- .../Inventory/DTOs/InventoryItemDTO.cs | 3 +- .../Configurations/IngredientConfiguration.cs | 2 +- .../Inventory/Entities/Ingredient.cs | 2 +- .../Inventory/Entities/InventoryBatch.cs | 2 +- .../Entities/InventoryTransaction.cs | 2 +- .../Inventory/Entities/LocationUnit.cs | 19 - CulinaryCommandApp/Inventory/Entities/Unit.cs | 6 +- .../Pages/Inventory/InventoryCatalog.razor | 251 +--- .../Pages/Inventory/InventoryManagement.razor | 8 +- .../Inventory/Services/IngredientService.cs | 17 +- .../Services/Interfaces/IIngredientService.cs | 7 +- .../Interfaces/IInventoryManagementService.cs | 4 +- .../IInventoryTransactionService.cs | 13 +- .../Services/Interfaces/IUnitService.cs | 9 +- .../Services/InventoryManagementService.cs | 18 +- .../Services/InventoryTransactionService.cs | 75 +- .../Inventory/Services/UnitService.cs | 46 +- ...2_RecipeAndLocationUnitSupport.Designer.cs | 1121 ---------------- ...0227192322_RecipeAndLocationUnitSupport.cs | 346 ----- ...0305191150_AddRecipeRowVersion.Designer.cs | 1126 ----------------- .../20260305191150_AddRecipeRowVersion.cs | 31 - .../20260306015138_SeedUnits.Designer.cs | 1126 ----------------- .../Migrations/20260306015138_SeedUnits.cs | 48 - .../Migrations/AppDbContextModelSnapshot.cs | 804 ++++++------ CulinaryCommandApp/Program.cs | 8 +- .../Entities/PurchaseOrderLine.cs | 2 +- .../PurchaseOrder/Pages/Create.razor | 2 +- .../Components/ProduceRecipeDialog.razor | 247 ---- CulinaryCommandApp/Recipe/Entities/Recipe.cs | 45 - .../Recipe/Entities/RecipeIngredient.cs | 30 - .../Recipe/Entities/RecipeStep.cs | 32 - .../Recipe/Entities/RecipeSubRecipe.cs | 12 - .../Recipe/Pages/IngredientLineRow.razor | 117 -- .../Recipe/Pages/RecipeCreate.razor | 83 -- .../Recipe/Pages/RecipeEdit.razor | 103 -- .../Recipe/Pages/RecipeForm.razor | 820 ------------ .../Recipe/Pages/RecipeList.razor | 486 ------- .../Recipe/Pages/RecipeList.razor.css | 391 ------ .../Recipe/Pages/RecipeView.razor | 257 ---- .../Recipe/Pages/RecipeView.razor.css | 321 ----- .../Recipe/Pages/_Imports.razor | 10 - .../Services/Interfaces/IRecipeService.cs | 51 - .../Recipe/Services/RecipeService.cs | 151 --- CulinaryCommandApp/Services/RecipeService.cs | 68 + .../DTOs/CreateIngredientDTOTests.cs | 3 +- .../DTOs/InventoryCatalogDTOTests.cs | 2 +- .../Inventory/DTOs/InventoryItemDTOTests.cs | 2 +- .../Inventory/Entities/IngredientTest.cs | 2 +- .../Entities/InventoryTransactionTest.cs | 2 +- .../Inventory/Entities/UnitTest.cs | 2 +- 71 files changed, 1346 insertions(+), 8129 deletions(-) delete mode 100644 CulinaryCommandApp/Components/Pages/EmployeeView.razor create mode 100644 CulinaryCommandApp/Components/Pages/Recipes/Create.razor create mode 100644 CulinaryCommandApp/Components/Pages/Recipes/Edit.razor create mode 100644 CulinaryCommandApp/Components/Pages/Recipes/Index.razor create mode 100644 CulinaryCommandApp/Components/Pages/Recipes/RecipeForm.razor create mode 100644 CulinaryCommandApp/Components/Pages/Recipes/RecipeList.razor create mode 100644 CulinaryCommandApp/Components/Pages/Recipes/RecipeView.razor create mode 100644 CulinaryCommandApp/Components/Pages/Recipes/RecipeView.razor.css create mode 100644 CulinaryCommandApp/Data/Entities/Ingredient.cs create mode 100644 CulinaryCommandApp/Data/Entities/MeasurementUnit.cs create mode 100644 CulinaryCommandApp/Data/Entities/Recipe.cs create mode 100644 CulinaryCommandApp/Data/Entities/RecipeIngredient.cs create mode 100644 CulinaryCommandApp/Data/Entities/RecipeStep.cs create mode 100644 CulinaryCommandApp/Data/Models/MeasurementUnitViewModel.cs delete mode 100644 CulinaryCommandApp/Inventory/Entities/LocationUnit.cs delete mode 100644 CulinaryCommandApp/Migrations/20260227192322_RecipeAndLocationUnitSupport.Designer.cs delete mode 100644 CulinaryCommandApp/Migrations/20260227192322_RecipeAndLocationUnitSupport.cs delete mode 100644 CulinaryCommandApp/Migrations/20260305191150_AddRecipeRowVersion.Designer.cs delete mode 100644 CulinaryCommandApp/Migrations/20260305191150_AddRecipeRowVersion.cs delete mode 100644 CulinaryCommandApp/Migrations/20260306015138_SeedUnits.Designer.cs delete mode 100644 CulinaryCommandApp/Migrations/20260306015138_SeedUnits.cs delete mode 100644 CulinaryCommandApp/Recipe/Components/ProduceRecipeDialog.razor delete mode 100644 CulinaryCommandApp/Recipe/Entities/Recipe.cs delete mode 100644 CulinaryCommandApp/Recipe/Entities/RecipeIngredient.cs delete mode 100644 CulinaryCommandApp/Recipe/Entities/RecipeStep.cs delete mode 100644 CulinaryCommandApp/Recipe/Entities/RecipeSubRecipe.cs delete mode 100644 CulinaryCommandApp/Recipe/Pages/IngredientLineRow.razor delete mode 100644 CulinaryCommandApp/Recipe/Pages/RecipeCreate.razor delete mode 100644 CulinaryCommandApp/Recipe/Pages/RecipeEdit.razor delete mode 100644 CulinaryCommandApp/Recipe/Pages/RecipeForm.razor delete mode 100644 CulinaryCommandApp/Recipe/Pages/RecipeList.razor delete mode 100644 CulinaryCommandApp/Recipe/Pages/RecipeList.razor.css delete mode 100644 CulinaryCommandApp/Recipe/Pages/RecipeView.razor delete mode 100644 CulinaryCommandApp/Recipe/Pages/RecipeView.razor.css delete mode 100644 CulinaryCommandApp/Recipe/Pages/_Imports.razor delete mode 100644 CulinaryCommandApp/Recipe/Services/Interfaces/IRecipeService.cs delete mode 100644 CulinaryCommandApp/Recipe/Services/RecipeService.cs create mode 100644 CulinaryCommandApp/Services/RecipeService.cs diff --git a/CulinaryCommandApp/Components/Pages/Assignments/AdminAssignTask.razor b/CulinaryCommandApp/Components/Pages/Assignments/AdminAssignTask.razor index 9480631..3b73c89 100644 --- a/CulinaryCommandApp/Components/Pages/Assignments/AdminAssignTask.razor +++ b/CulinaryCommandApp/Components/Pages/Assignments/AdminAssignTask.razor @@ -4,16 +4,13 @@ @using CulinaryCommand.Services @using CulinaryCommand.Data.Enums; @using CulinaryCommand.Services.UserContextSpace -@using CulinaryCommandApp.Recipe.Services; -@using CulinaryCommandApp.Recipe.Services.Interfaces; -@using CulinaryCommandApp.Recipe.Entities; @inject IUserContextService UserCtx @inject NavigationManager Nav @inject ILocationService LocationService @inject IUserService UserService @inject LocationState LocationState @inject ITaskAssignmentService TaskService -@inject IRecipeService RecipeService +@inject RecipeService RecipeService @implements IDisposable @rendermode InteractiveServer @@ -349,8 +346,11 @@ else try { - recipes = await RecipeService.GetAllByLocationIdAsync(selectedLocationId.Value); - recipes = recipes.OrderBy(r => r.Title).ToList(); + var all = await RecipeService.GetAllAsync(); + recipes = all + .Where(r => r.LocationId == selectedLocationId.Value) + .OrderBy(r => r.Title) + .ToList(); } catch { diff --git a/CulinaryCommandApp/Components/Pages/EmployeeView.razor b/CulinaryCommandApp/Components/Pages/EmployeeView.razor deleted file mode 100644 index 82f700d..0000000 --- a/CulinaryCommandApp/Components/Pages/EmployeeView.razor +++ /dev/null @@ -1,64 +0,0 @@ -@rendermode InteractiveServer - -@using CulinaryCommand.Components.Custom -@using CulinaryCommand.Services.UserContextSpace -@using CulinaryCommand.Services - -@inject IUserContextService UserCtx -@inject LocationState LocationState - -
No location assigned. Please contact your manager.
- } - else - { -Welcome to @LocationState.CurrentLocation.Name.
- -Loading...
+} +else +{ +Loading...
+} +else +{ +| Title | +Category | +Type | +Yield | ++ |
|---|---|---|---|---|
| @r.Title | +@r.Category | +@r.RecipeType | +@FormatYield(r) | ++ + @if (priv) + { + + + } + | +
Loading...
+ } + else + { +No ingredients added.
+ } + else + { +No steps added.
+ } + else + { +| Name | -Abbreviation | -- |
|---|---|---|
| @unit.Name | -@unit.Abbreviation | -- - | -
@(LocationState.CurrentLocation is not null ? $"{LocationState.CurrentLocation.Name} β ingredient catalog" : "Manage your ingredient catalog")
+Manage your ingredient catalog