feat(service): huỷ dịch vụ, SSL, đổi mật khẩu hosting, lịch sử thanh toán theo hình thức

- Lịch sử thanh toán hoá đơn trả thêm `method` (tự động gia hạn / số dư / admin / chuyển khoản / hoàn tiền), bỏ đuôi `(method)` khỏi ghi chú
- `DnsServer::panelUrl()` = https://<domain>/ dùng cho email cấp hosting và nút Plesk của khách
- Order item trả thêm `uuid`/`type` của dịch vụ để FE dẫn tới trang quản lý
- Yêu cầu huỷ dịch vụ, chứng chỉ SSL, lịch sử gia hạn, đổi mật khẩu hosting cho khách

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-28 16:40:24 +07:00
co-authored by Claude Sonnet 5.5
parent a6b641015e
commit b44a88bb52
72 changed files with 1701 additions and 231 deletions
@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace Tests\Feature\Api\Admin\Product;
use App\Models\Product;
use App\Models\ProductCategories;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Spatie\Permission\Models\Role;
use Tests\TestCase;
class ProductCategoryFilterTest extends TestCase
{
use RefreshDatabase;
public function test_category_filter_applies_before_pagination(): void
{
Role::firstOrCreate(['name' => 'Full Administrator', 'guard_name' => 'admin']);
$admin = User::factory()->create();
$admin->assignRole('Full Administrator');
$wordpress = ProductCategories::create([
'name' => 'HOSTING WORDPRESS',
'slug' => 'wordpress-hosting',
'type' => 'hosting',
'is_active' => true,
'sort_order' => 1,
]);
$other = ProductCategories::create([
'name' => 'Other',
'slug' => 'other',
'type' => 'hosting',
'is_active' => true,
'sort_order' => 2,
]);
$expected = Product::factory()->create(['product_categories_id' => $wordpress->id]);
Product::factory()->count(16)->create(['product_categories_id' => $other->id]);
$this->actingAs($admin, 'admin')
->getJson("/api/v1/administrator/products?per_page=15&product_categories_id={$wordpress->id}")
->assertOk()
->assertJsonPath('data.total', 1)
->assertJsonCount(1, 'data.items')
->assertJsonPath('data.items.0.id', $expected->id);
}
}