Warenwirtschaft: AP-32-Brückenlösung — DHL-Label aus WooCommerce übernehmen
Bestell-Übertragung (wp/order) akzeptiert wp_label_url + wp_tracking_number: Label-PDF wird als lokale Kopie im privaten Storage gespeichert (Shop-URL ist öffentlich erratbar; Kopie überlebt Löschung im Shop), Sendungsnummer landet in shopping_orders.tracking. Neuer Endpoint wp/label zum Nachreichen (Connector-Hook pr_save_dhl_label_tracking), wp/status liefert die Sendungsnummer an den Shop zurück. Abwicklungs-Board + Bestell-Details zeigen Label-Download (copyreader-Dokumentroute type=label, Fallback Shop-Link) und Sendungsnummer. Download-Fehler blockieren die Übertragung nie. Doku: Connector-Update-Anleitung (dev/product management), Hinweise, Testleitfaden §11, Plan-Protokoll. pint.json schließt dev/ (Fremdcode) aus. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
a1f94ea427
commit
0eed974576
13 changed files with 611 additions and 25 deletions
|
|
@ -166,9 +166,20 @@ class OrderFulfillmentController extends Controller
|
|||
*/
|
||||
public function document(int $id, string $type)
|
||||
{
|
||||
abort_unless(in_array($type, ['invoice', 'delivery', 'combined'], true), 404);
|
||||
abort_unless(in_array($type, ['invoice', 'delivery', 'combined', 'label'], true), 404);
|
||||
|
||||
$order = ShoppingOrder::query()->findOrFail($id);
|
||||
|
||||
// AP-32 Brückenlösung: lokal gespeicherte Kopie des DHL-Labels aus dem
|
||||
// WooCommerce-Shop (privater Storage — bewusst nicht die öffentliche Shop-URL)
|
||||
if ($type === 'label') {
|
||||
abort_unless($order->wp_label_path && Storage::disk('local')->exists($order->wp_label_path), 404);
|
||||
|
||||
return Response::make(Storage::disk('local')->get($order->wp_label_path), 200)
|
||||
->header('Content-Type', 'application/pdf')
|
||||
->header('Content-disposition', 'inline; filename="DHL-Label-Bestellung-'.$order->id.'.pdf"');
|
||||
}
|
||||
|
||||
abort_unless(Invoice::isInvoice($order), 404);
|
||||
|
||||
if ($type === 'combined') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue