<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class EquityPlan extends Model
{
    protected $fillable = [
        'organisation_id',
        'name',
        'equity_type',
        'share_price',
        'vesting_period_months',
        'active',
        'start_date',
        'end_date',
        'description',
    ];

    public function organisation()
    {
        return $this->belongsTo(Organisation::class);
    }

    public function awards()
    {
        return $this->hasMany(EquityAward::class);
    }

    public function scopeActive($query)
    {
        return $query->where('active', true);
    }
}
