<?php

declare(strict_types=1);

namespace App\Support;

use App\Filament\Resources\DberpPurchaseExceptions\DberpPurchaseExceptionResource;
use App\Filament\Resources\DberpPurchasePriceReferences\DberpPurchasePriceReferenceResource;
use App\Filament\Resources\DberpPurchaseReturns\DberpPurchaseReturnResource;
use App\Models\DberpSupplier;

final class DberpSupplierPerformanceFilamentSupport
{
    public static function purchaseExceptionIndexUrl(DberpSupplier $supplier): string
    {
        return DberpFilamentListPageUrl::append(
            DberpPurchaseExceptionResource::getUrl('index'),
            ['supplier_id' => ['value' => (int) $supplier->getKey()]],
        );
    }

    public static function purchaseReturnIndexUrl(DberpSupplier $supplier): string
    {
        return DberpFilamentListPageUrl::append(
            DberpPurchaseReturnResource::getUrl('index'),
            ['supplier_id' => ['value' => (int) $supplier->getKey()]],
        );
    }

    public static function purchasePriceReferenceIndexUrl(DberpSupplier $supplier): string
    {
        return DberpFilamentListPageUrl::append(
            DberpPurchasePriceReferenceResource::getUrl('index'),
            [
                'scope_type' => ['value' => 'supplier_product'],
                'supplier_id' => ['value' => (int) $supplier->getKey()],
            ],
        );
    }
}
