add more controllers and fix tests

This commit is contained in:
root
2026-03-09 11:54:13 -04:00
parent 0c3e9b16f7
commit 1cb3573d4b
74 changed files with 2761 additions and 2728 deletions
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources\PurchaseOrders;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PurchaseOrderItemResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => (int) ($this->resource['id'] ?? 0),
'purchase_order_id' => (int) ($this->resource['purchase_order_id'] ?? 0),
'supply_id' => (int) ($this->resource['supply_id'] ?? 0),
'supply_name' => $this->resource['supply_name'] ?? null,
'supply_unit' => $this->resource['supply_unit'] ?? null,
'description' => $this->resource['description'] ?? null,
'quantity' => (int) ($this->resource['quantity'] ?? 0),
'received_qty' => (int) ($this->resource['received_qty'] ?? 0),
'unit_cost' => (float) ($this->resource['unit_cost'] ?? 0),
];
}
}