🔪 Extraction Target
Extract all stock-related operations from the 19,843-line index.mjs into a focused StockService class. No backward compatibility. No mercy.
📁 Methods to Extract
// All of these get ripped out and moved to StockService
addToStock()
consumeFromStock()
inventoryProduct()
openProduct()
getStock()
getStockEntries()
getStockEntry()
getStockLocations()
getStockProductDetails()
transferProduct()
// ... and any other stock-related methods
🎯 Definition of Done
⚡ Implementation
// services/StockService.js
export class StockService extends BaseService {
async addToStock(productId, amount, bestBeforeDate, price, locationId, transactionType) {
// Direct copy from index.mjs - no changes
}
async consumeFromStock(productId, amount, spoiled, locationId, recipeId, exact) {
// Direct copy from index.mjs - no changes
}
// ... rest of stock methods
}
🚫 NOT in Scope
- Backward compatibility
- Deprecation warnings
- Proxy methods in GrocyClient
- Changing method signatures
- Adding new features
💀 Breaking Changes
Yes. Deal with it. Update your code.
Related to
Parent issue: #11
🔪 Extraction Target
Extract all stock-related operations from the 19,843-line index.mjs into a focused StockService class. No backward compatibility. No mercy.
📁 Methods to Extract
🎯 Definition of Done
services/StockService.jsextending BaseService⚡ Implementation
🚫 NOT in Scope
💀 Breaking Changes
Yes. Deal with it. Update your code.
Related to
Parent issue: #11