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:
@@ -193,9 +193,30 @@ class ClientController extends Controller
|
||||
$client = $result['client'];
|
||||
$this->activityLogger->logAuth('register', 'customer', $client->id, $client->email);
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => 'Đăng ký thành công. Vui lòng kiểm tra email và nhập mã xác thực để kích hoạt tài khoản.',
|
||||
]);
|
||||
}
|
||||
|
||||
public function verifyEmail(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'code' => ['required', 'string', 'size:6'],
|
||||
]);
|
||||
|
||||
$result = $this->authService->verifyEmail(
|
||||
$request->input('email'),
|
||||
$request->input('code'),
|
||||
);
|
||||
|
||||
$client = $result['client'];
|
||||
$this->activityLogger->logAuth('email_verified', 'customer', $client->id, $client->email);
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'data' => [
|
||||
'data' => [
|
||||
'client' => new ClientResource($client->loadCount(['vps', 'hosting', 'domain'])),
|
||||
'token' => $result['token'],
|
||||
'refresh_token' => $result['refresh_token'],
|
||||
@@ -204,6 +225,20 @@ class ClientController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function resendVerifyCode(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
]);
|
||||
|
||||
$this->authService->resendVerifyCode($request->input('email'));
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => 'Nếu email tồn tại và chưa xác thực, mã xác thực mới đã được gửi.',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* path="/client/logout",
|
||||
|
||||
Reference in New Issue
Block a user