<?php

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

use App\Http\Controllers\Controller;
use App\Models\Tenancy\CanceledVisit;
use Spatie\QueryBuilder\QueryBuilder;

class GetCanceledVisits extends Controller
{
    public function __invoke()
    {
        return $this->ok(
            QueryBuilder::for(CanceledVisit::class)
                ->with('clientProcedure', 'clientProcedure.procedure')
                ->where('client_id', auth()->user()->detail->id)
                ->jsonPaginate()
        );
    }
}
