<?php

namespace App\Http\Controllers\v1\Tenancy\Product;

use App\Http\Controllers\Controller;
use App\Models\Tenancy\Order;
use Illuminate\Http\Response;
use Spatie\QueryBuilder\QueryBuilder;

class GetOrdersController extends Controller
{
    public function __invoke(string $clientUniqueId): Response
    {
        return $this->ok(
            QueryBuilder::for(Order::where('client_unique_id', $clientUniqueId))
                ->allowedFilters([
                    'status',
                ])
                ->jsonPaginate()
        );
    }
}
