From 6c47be8821c3618b114ebf8558b4e6707c4fd649 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Tue, 21 Jul 2026 11:26:36 +0700 Subject: [PATCH] fix: set default value for reject_stock in product variant updates --- app/Services/Master/ProductService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Master/ProductService.php b/app/Services/Master/ProductService.php index c9be7bf..8d98c6d 100644 --- a/app/Services/Master/ProductService.php +++ b/app/Services/Master/ProductService.php @@ -575,7 +575,7 @@ private function applyPayloadToProduct( $variant->update([ 'name' => $variantData['name'], 'stock' => $variantData['stock'], - 'reject_stock' => $variantData['reject_stock'], + 'reject_stock' => $variantData['reject_stock'] ?? 0, 'retail_stock' => $variantData['retail_stock'], ]); @@ -598,7 +598,7 @@ private function applyPayloadToProduct( $variant = $product->variants()->create([ 'name' => $variantData['name'], 'stock' => $variantData['stock'], - 'reject_stock' => $variantData['reject_stock'], + 'reject_stock' => $variantData['reject_stock'] ?? 0, 'retail_stock' => $variantData['retail_stock'], ]);