- Document upsert에 rendered_html 필드 추가 - Lazy Snapshot API (snapshot_document_id resolve) - UpsertRequest rendered_html 검증 추가 - DocumentTemplateSection description 컬럼 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Documents;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
/**
|
|
* 문서 양식 섹션 모델
|
|
*
|
|
* @property int $id
|
|
* @property int $template_id
|
|
* @property string $title 섹션 제목
|
|
* @property string|null $image_path 검사 기준 이미지 경로
|
|
* @property int $sort_order 정렬 순서
|
|
*/
|
|
class DocumentTemplateSection extends Model
|
|
{
|
|
protected $table = 'document_template_sections';
|
|
|
|
protected $fillable = [
|
|
'template_id',
|
|
'title',
|
|
'description',
|
|
'image_path',
|
|
'sort_order',
|
|
];
|
|
|
|
protected $casts = [
|
|
'sort_order' => 'integer',
|
|
];
|
|
|
|
public function template(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DocumentTemplate::class, 'template_id');
|
|
}
|
|
|
|
public function items(): HasMany
|
|
{
|
|
return $this->hasMany(DocumentTemplateSectionItem::class, 'section_id')
|
|
->orderBy('sort_order');
|
|
}
|
|
}
|