<?php

namespace App\Repositories\Eloquent;

use App\Models\BatchSizeConfig;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;

class BatchSizeConfigRepository extends BaseRepository
{
    protected function resolveModel(): Model
    {
        return new BatchSizeConfig();
    }

    public function getActive(): Collection
    {
        return $this->model->active()->orderBy('size_value')->get();
    }

    public function findByCode(string $code): ?BatchSizeConfig
    {
        return $this->model->where('size_code', $code)->first();
    }
}
