<?php

namespace App\Modules\HR\Overtime\Repositories;

use App\Modules\HR\Overtime\Models\OvertimeRatePolicy;

class OvertimeRatePolicyRepository
{
    public function defaultForTenant(int $tenantId): ?OvertimeRatePolicy
    {
        return OvertimeRatePolicy::query()
            ->where('tenant_id', $tenantId)
            ->where('is_active', true)
            ->orderByDesc('is_default')
            ->orderBy('id')
            ->first();
    }
}
