<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Meeting extends Model
{
    use HasFactory;

    protected $fillable = [
        'topic',
        'project_id',
        'employee_ids',
        'start_time',
        'duration',
        'client_id'
    ];

    // Relationship with Project
    public function project()
    {
        return $this->belongsTo(Project::class);
    }

    // Relationship with Client
    public function client()
    {
        return $this->belongsTo(Client::class);
    }

    // Relationship with Employees (multiple)
    public function employees()
    {
        return $this->belongsToMany(Employee::class, 'employee_meeting', 'meeting_id', 'employee_id');
    }
}
