<?php

namespace Kylin\Dictionary\Models;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Kylin\Core\Models\BaseModel;

/**
 * 字典类型模型
 *
 * 数据字典的类型定义，如"性别"、"订单状态"等。
 *
 * @property string $code        字典编码
 * @property string $name        字典名称
 * @property string $description 描述
 */
class DictType extends BaseModel
{
    protected $table = 'kylin_dict_types';

    protected $fillable = ['code', 'name', 'description'];

    public function items(): HasMany
    {
        return $this->hasMany(DictItem::class, 'type_id');
    }
}
