feat: Implement client-facing service management API with UUID for services and bulk actions for product services.

This commit is contained in:
pbao9
2026-03-13 15:17:23 +07:00
parent 5160ac967a
commit e0341363f6
16 changed files with 479 additions and 3 deletions
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Resources\Api\Client\Service;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class ServiceClientResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
if (!$this->resource) {
return [];
}
return [
'uuid' => $this->uuid,
'vm_id' => $this->vm_id,
'status' => $this->status,
'auto_renew' => $this->auto_renew,
'started_at' => $this->started_at?->toISOString(),
'expires_at' => $this->expires_at?->toISOString(),
];
}
}