Enhance VM service management: add service_id and plain_password fields, sync service records, and update related migrations

This commit is contained in:
pbao9
2026-04-16 09:39:52 +07:00
parent bb73d6c5a2
commit d68fda2cf0
11 changed files with 206 additions and 104 deletions
@@ -13,14 +13,14 @@ class ServiceClientRepository extends BaseApiRepository implements ServiceClient
}
/**
* Lấy danh sách sản phẩm đang hoạt động
* Lấy toàn bộ dịch vụ của customer (mọi trạng thái)
*/
public function getActiveServices(int $limit = 10)
{
return $this->model
->with(['orderItem' => fn($q) => $q->with('product')])
->where('status', 'active')
->orderBy('started_at', 'asc')
->orderByRaw("FIELD(status, 'active', 'pending', 'suspended', 'expired', 'cancelled', 'terminated')")
->orderBy('started_at', 'desc')
->paginate($limit);
}
@@ -50,7 +50,8 @@ class ServiceClientRepository extends BaseApiRepository implements ServiceClient
->with([
'orderItem.os.osGroup',
'orderItem.product',
'orderItem.order.vmWare.ipAddress',
'orderItem.order',
'vmware.ipAddress',
])
->where('uuid', $uuid)
->first();