<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class MasterJourneyPlan extends Model
{
    // Mengizinkan mass-assignment untuk kolom-kolom ini
    protected $fillable = [
        'salesman_id', 
        'customer_id', 
        'day_of_week', 
        'frequency_type', 
        'week_number', 
        'is_active'
    ];

    // Relasi ke tabel salesmen
    public function salesman(): BelongsTo 
    {
        return $this->belongsTo(Salesman::class);
    }

    // Relasi ke tabel customers
    public function customer(): BelongsTo 
    {
        return $this->belongsTo(Customer::class);
    }
}