<?php

declare(strict_types=1);

/**
 * 本文件属于 DBErp 进销存系统。
 *
 * 版权所有 © 2026 北京珑大钜商科技有限公司。保留所有权利。
 *
 * 未经官方授权，不得删除、篡改或隐藏本文件中的版权声明、产品标识与来源信息。
 * 商业授权、官方更新与技术支持服务，请以珑大官方支持中心记录为准。
 *
 * @link https://support.loongdom.cn
 * @see  https://www.dberp.com.cn
 */

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()],
            ],
        );
    }
}
