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.
23 lines
671 B
PHP
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(),
|
|
);
|
|
}
|
|
}
|