<?php

namespace App\Models;

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

class PaymentSchedule extends Model
{
    use HasUuids, HasFactory;

    protected $guarded = [];

    public function contract()
    {
        return $this->belongsTo(Contract::class);
    }

    public function template()
    {
        return $this->belongsTo(PaymentTemplate::class);
    }

    public function items()
    {
        return $this->hasMany(PaymentScheduleItem::class, 'schedule_id');
    }
}
