feat:문서관리 Phase 4.1 - DocumentTemplate API + 결재 워크플로우 활성화
- DocumentTemplate 모델 6개 생성 (Template, ApprovalLine, BasicField, Section, SectionItem, Column)
- DocumentTemplateService (list/show) + DocumentTemplateController (index/show)
- GET /v1/document-templates, GET /v1/document-templates/{id} 라우트
- DocumentTemplateApi.php Swagger (7개 스키마, 2개 엔드포인트)
- Document 결재 워크플로우 4개 엔드포인트 활성화 (submit/approve/reject/cancel)
- ApproveRequest, RejectRequest FormRequest 생성
- DocumentApi.php Swagger에 결재 엔드포인트 4개 추가
- Document.template() 참조 경로 수정 (DocumentTemplate → Documents 네임스페이스)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
43
app/Models/Documents/DocumentTemplateSection.php
Normal file
43
app/Models/Documents/DocumentTemplateSection.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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',
|
||||
'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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user