Add feature tests for domain order management
- 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.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user