- Implement AdminDomainOrderTest to cover admin functionalities for domain orders including listing, confirming registration, KYC updates, activation, rejection, and refunds. - Implement ClientDomainOrderTest to cover client functionalities for placing domain orders, including validation for balance, duplicate orders, and domain normalization. - Ensure proper handling of domain pricing and service statuses throughout the tests.
31 lines
713 B
PHP
31 lines
713 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api\Client\Domain;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreDomainOrderRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'product_uuid' => ['required', 'string'],
|
|
'domain_name' => ['required', 'string', 'max:255'],
|
|
'years' => ['nullable', 'integer', 'min:1', 'max:3'],
|
|
];
|
|
}
|
|
|
|
/** Default years to 1 if omitted. */
|
|
protected function prepareForValidation(): void
|
|
{
|
|
if (!$this->has('years') || $this->years === null) {
|
|
$this->merge(['years' => 1]);
|
|
}
|
|
}
|
|
}
|