gruene-seele/app/Services
Kevin Adametz 35b9076cbc Warenwirtschaft: AP-31 Löschen mit Soft-Delete + Abhängigkeitsprüfung
Anforderung 15.07.2026: Nahezu alle WaWi-Einträge sind jetzt löschbar
(Soft-Delete, deleted_at), mit Abhängigkeitsprüfung und Bestätigungs-
warnung vor jeder Löschung.

- Migration: deleted_at auf 14 WaWi-Tabellen (Stammdaten, ingredients,
  stock_entries, stock_disposals, productions); SoftDeletes-Trait in
  den Models (suppliers/packaging_items hatten es bereits).
- Neuer App\Services\DeletionGuard: zentrale Abhängigkeitsprüfung je
  Entität — referenzierte Einträge sind nicht löschbar, Fehlermeldung
  nennt die Verwendungen (behebt auch Audit M-4: kein 500er/stiller
  Cascade-Verlust mehr beim Löschen verwendeter Stammdaten).
- SettingCrudController::destroy() prüft Blocker; Supplier-,
  PackagingItem-, Ingredient-destroy ebenso (Ingredient: vollständige
  Prüfung inkl. Produktion/Ausschuss, Route GET→DELETE, Audit M-6).
- Wareneingänge: auch gebuchte Eingänge löschbar, sofern kein
  Produktions-Verbrauch/Ausschuss darauf gebucht ist.
- Ausschuss: löschbar (Menge steht dem Bestand wieder zur Verfügung).
- Produktionen: löschbar (admin >= 7); Produktbestand wird per
  Gegenbuchung zurückgeführt (reverseProductionStock, append-only,
  withTrashed), Rohstoffverbrauch zählt nicht mehr (Bestandsqueries
  schließen gelöschte Produktionen aus).
- lastNetPricePerSupplier: DB::query statt Model-Query (Global Scope
  auf Sub-Select-Alias).
- Debug-Log-Reste im PackagingItemController entfernt (Audit N-16).
- Views: Lösch-Buttons mit deutschen Bestätigungswarnungen (Ausschuss,
  Produktionen, gebuchte Wareneingänge, INCI als DELETE-Formular).

Tests: neuer InventoryDeletionTest (10 Tests), StorageSettingsTest an
neue Löschregel angepasst. Volle Suite: 214 grün, 783 Assertions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 12:31:11 +00:00
..
Facade first commit 2021-01-08 17:48:20 +01:00
Payment commit 08-2025 2025-08-12 15:51:04 +02:00
Stats Updates to 03-2025 2025-04-01 10:39:21 +02:00
Yard User Order all Margins / Checkout 2021-01-22 15:54:51 +01:00
Credit.php Gutschriften Anpassungen 2021-04-29 16:36:11 +02:00
CustomerPriority.php Zugriff Redakteur, Kundenhoheit API 2022-01-04 11:17:07 +01:00
DeletionGuard.php Warenwirtschaft: AP-31 Löschen mit Soft-Delete + Abhängigkeitsprüfung 2026-07-15 12:31:11 +00:00
HomepartyCart.php first commit 2021-01-08 17:48:20 +01:00
HomepartyUserCart.php first commit 2021-01-08 17:48:20 +01:00
HTMLHelper.php April 2026 waren Wirtschaft Feedback 2026-04-10 17:14:38 +02:00
InventoryService.php Warenwirtschaft: AP-31 Löschen mit Soft-Delete + Abhängigkeitsprüfung 2026-07-15 12:31:11 +00:00
Invoice.php April 2026 waren Wirtschaft Feedback 2026-04-10 17:14:38 +02:00
MyLog.php Updates to 03-2025 2025-04-01 10:39:21 +02:00
MyPDFMerger.php Work to invoice 2021-02-10 10:42:24 +01:00
Payment.php commit 08-2025 2025-08-12 15:51:04 +02:00
PaymentHelper.php commit 08-2025 2025-08-12 15:51:04 +02:00
PaymentReminderService.php April 2026 waren Wirtschaft Feedback 2026-04-10 17:14:38 +02:00
PaymentService.php commit 08-2025 2025-08-12 15:51:04 +02:00
PDFMerger.php commit 08-2025 2025-08-12 15:51:04 +02:00
ProductImage.php Updates to 03-2025 2025-04-01 10:39:21 +02:00
ProductionService.php Warenwirtschaft: AP-31 Löschen mit Soft-Delete + Abhängigkeitsprüfung 2026-07-15 12:31:11 +00:00
ProductStockService.php Warenwirtschaft: AP-31 Löschen mit Soft-Delete + Abhängigkeitsprüfung 2026-07-15 12:31:11 +00:00
Shop.php Updates to 03-2025 2025-04-01 10:39:21 +02:00
Slim.php User Order all Margins / Checkout 2021-01-22 15:54:51 +01:00
SysLog.php first commit 2021-01-08 17:48:20 +01:00
Type.php Updates to 03-2025 2025-04-01 10:39:21 +02:00
UserCart.php Updates to 03-2025 2025-04-01 10:39:21 +02:00
UserHelper.php Updates to 03-2025 2025-04-01 10:39:21 +02:00
UserMarign.php commit 08-2025 2025-08-12 15:51:04 +02:00
UserService.php commit 08-2025 2025-08-12 15:51:04 +02:00
Util.php commit 08-2025 2025-08-12 15:51:04 +02:00
Yard.php Updates to 03-2025 2025-04-01 10:39:21 +02:00