This commit is contained in:
2025-12-10 13:01:39 +05:00
parent 8c38dd846f
commit 125d619935
3 changed files with 33 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ class CheckoutOrderRequest extends FormRequest
'customer_address' => ['required', 'string', 'max:255'],
'shipping_method' => ['required', 'string', 'max:255', Rule::in(array_keys(OrderShipping::values()))],
'shipping_price' => ['nullable', 'numeric'],
'payment_type_id' => ['required', Rule::in(array_keys(OrderPayment::values()))],
'notes' => ['nullable', 'string', 'max:255'],
@@ -70,7 +71,7 @@ class CheckoutOrderRequest extends FormRequest
'user_id' => auth()->id(),
'notes' => $this->notes ?: null,
'province_id' => $this->province_id ?: null,
'shipping_price' => OrderShipping::priceFor($this->shipping_method),
'shipping_price' => $this->shipping_price ?: OrderShipping::priceFor($this->shipping_method),
'delivery_time' => $this->delivery_time ?: OrderShipping::MORNING,
'delivery_at' => $this->delivery_at ?: date('Y-m-d'),
'source_app' => $this->source ?: OS::MOBILE_APP,