<?php

namespace App\Repositories;

use App\Models\VolumeHoraire;

class VolumeHoraireRepository extends BaseRepository
{
    public function __construct(VolumeHoraire $model)
    {
        parent::__construct($model);
    }

    public function findByLibelle($libelle)
    {
        return $this->query->where('libelle', $libelle)->first();
    }

    public function getStatistics()
    {
        return [
            'total' => $this->count(),
            'total_volume' => $this->query->sum('volume_horaire'),
        ];
    }
}
