-
Notifications
You must be signed in to change notification settings - Fork 0
[EXTRACT] RecipeService - Rip recipe operations from monolith #46
Copy link
Copy link
Open
Description
🔪 Extraction Target
Extract all recipe and meal planning operations from the 19,843-line index.mjs into a focused RecipeService class. Clean extraction. No compatibility nonsense.
📁 Methods to Extract
// All of these get ripped out and moved to RecipeService
getRecipes()
getRecipe()
createRecipe()
updateRecipe()
deleteRecipe()
getRecipeFulfillment()
addRecipeToMealPlan()
getMealPlan()
consumeRecipe()
// ... and any other recipe-related methods🎯 Definition of Done
- Create
services/RecipeService.jsextending BaseService - Extract ALL recipe methods from index.mjs
- File size < 500 lines (enforced by linter)
- All existing tests pass WITHOUT modification
- Add JSDoc comments for each method
- No deprecated methods or compatibility layers
- Update all imports/references in index.mjs
- Zero regression - identical functionality
⚡ Implementation
// services/RecipeService.js
export class RecipeService extends BaseService {
async getRecipes() {
// Direct copy from index.mjs - no changes
}
async getRecipe(recipeId) {
// Direct copy from index.mjs - no changes
}
async consumeRecipe(recipeId, servings) {
// Direct copy from index.mjs - no changes
}
// ... rest of recipe methods
}🚫 NOT in Scope
- Backward compatibility
- Deprecation warnings
- Proxy methods in GrocyClient
- Changing method signatures
- Adding new features
💀 Breaking Changes
Yes. Fix your imports.
Related to
Parent issue: #11
Reactions are currently unavailable