update project
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Requests\Finance;
|
||||
|
||||
use App\Domain\SchoolCore\Finance\DTO\MoneyData;
|
||||
use App\Domain\SchoolCore\Finance\DTO\RefundPaymentData;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
final class RefundPaymentRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool { return true; }
|
||||
public function rules(): array { return ['payment_id'=>['required','integer','min:1'],'amount_minor'=>['required','integer','min:1'],'currency'=>['required','string','size:3'],'reason'=>['required','string'],'idempotency_key'=>['nullable','string']]; }
|
||||
public function toDTO(): RefundPaymentData { $v=$this->validated(); return new RefundPaymentData((int)$v['payment_id'], new MoneyData((int)$v['amount_minor'], strtoupper($v['currency'])), $v['reason'], $v['idempotency_key'] ?? null); }
|
||||
}
|
||||
Reference in New Issue
Block a user