feat: add domain registration form and email notifications

- Create a new Blade view for domain registration (`registrant-tochuc.blade.php`) to capture organization and manager details.
- Implement email templates for new domain orders for both admin (`domain-order-new.blade.php`) and customers (`domain-order-received.blade.php`).
- Add CSV exports for client and domain data.
- Introduce tests for customer mass assignment, password reset, login throttling, and permission gating.
- Ensure service renewals use current pricing and validate ownership for virtual machines.
- Validate mass assignment behavior in service model.
This commit is contained in:
baodev0
2026-08-22 17:30:55 +07:00
parent eec2c5906e
commit c377c7e195
58 changed files with 3063 additions and 418 deletions
@@ -103,6 +103,41 @@ class RolePermissionController extends Controller
]);
}
/**
* POST /v1/administrator/role-permissions
* Tạo một vai trò mới (chỉ Full Administrator)
*/
public function store(Request $request): JsonResponse
{
if (!$this->ensureFullAdmin()) {
return response()->json(['error' => true, 'message' => 'Bạn không có quyền truy cập'], 403);
}
$name = trim($request->input('name', ''));
if (!$name) {
return response()->json(['error' => true, 'message' => 'Tên vai trò không được trống'], 422);
}
if ($name === 'Full Administrator') {
return response()->json(['error' => true, 'message' => 'Tên vai trò không hợp lệ'], 422);
}
if (Role::where('guard_name', 'admin')->where('name', $name)->exists()) {
return response()->json(['error' => true, 'message' => "Vai trò \"{$name}\" đã tồn tại"], 422);
}
$role = Role::create(['name' => $name, 'guard_name' => 'admin']);
return response()->json([
'error' => false,
'data' => [
'id' => $role->id,
'name' => $role->name,
'permissions' => [],
],
], 201);
}
/**
* POST /v1/administrator/role-permissions/permissions
* Tạo một nhóm permissions mới theo module (chỉ Full Administrator)