feat: Enhance ServiceClientResource and InvoiceRepository with additional data fields; remove unused SVG icons

This commit is contained in:
pbao9
2026-04-17 14:43:17 +07:00
parent 5043bea79a
commit f4145088e1
6 changed files with 22 additions and 28 deletions
@@ -18,13 +18,26 @@ class ServiceClientResource extends JsonResource
return [];
}
$orderItem = $this->orderItem;
$product = $orderItem?->product;
return [
'uuid' => $this->uuid,
'uuid' => $this->uuid,
'server_name' => $this->server_name,
'status' => $this->status,
'auto_renew' => $this->auto_renew,
'started_at' => $this->started_at?->toISOString(),
'expires_at' => $this->expires_at?->toISOString(),
'status' => $this->status,
'auto_renew' => $this->auto_renew,
'started_at' => $this->started_at?->toISOString(),
'expires_at' => $this->expires_at?->toISOString(),
'os' => [
'version' => $orderItem?->os?->version,
'group' => $orderItem?->os?->osGroup?->name,
],
'specs' => $product ? [
'cpu' => (int) ($product->cpu ?? 0),
'ram' => (int) ($product->ram ?? 0),
'disk' => (int) ($product->disk ?? 0),
'bandwidth' => (int) ($product->bandwidth ?? 0),
] : null,
];
}
}