<?php

namespace Kylin\LawCase\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 案件里程碑模型
 *
 * 记录案件关键节点和里程碑事件。
 *
 * @property string $milestone_type 里程碑类型
 * @property string $milestone_date 里程碑日期
 * @property string $description    描述
 */
class CaseMilestone extends Model
{
    protected $table = 'kylin_law_case_milestones';

    protected $fillable = [
        'case_id',
        'milestone_type',
        'milestone_date',
        'description',
    ];

    protected $casts = [
        'milestone_date' => 'date',
    ];

    public function case()
    {
        return $this->belongsTo(CaseModel::class, 'case_id');
    }
}
