ldc-cocotte/app/Http/Requests/Bo/Discounts/UpdateDiscountRequest.php
Jérémy Munsch d0efb0f527
refactor: update namespaces for actions and queries
Refactored the codebase to change the namespaces of various actions and queries from `App\Actions` to `App\Cqs\Actions` and `App\Queries` to `App\Cqs\Queries`. This restructuring improves organization and clarity in the codebase.
2026-11-10 15:13:26 +01:00

23 lines
671 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Requests\Bo\Discounts;
use App\Cqs\Actions\Discounts\UpdateDiscountInput;
use App\Models\Discount;
class UpdateDiscountRequest extends StoreDiscountRequest
{
public function toUpdateDiscountInput(Discount $discount): UpdateDiscountInput
{
return new UpdateDiscountInput(
discount: $discount,
type: $this->toDiscountType(),
value: $this->toDiscountValue(),
is_old_price_displayed: $this->boolean('is_old_price_displayed'),
period: $this->toDatePeriod(),
associatedProductsIds: $this->toAssociatedProductsIds(),
);
}
}