<?php

namespace App\Models;

use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;

class PayrollPeriod extends Model
{
    use BelongsToTenant;

    protected $fillable = ['tenant_id', 'period_name', 'period_start', 'period_end', 'payment_date', 'status'];

    protected $casts = ['period_start' => 'date', 'period_end' => 'date', 'payment_date' => 'date'];

    public function runs()
    {
        return $this->hasMany(PayrollRun::class);
    }
}
