feat: 문서 rendered_html 스냅샷 저장 지원
- Document 모델 $fillable에 rendered_html 추가 - DocumentService create/update에서 rendered_html 저장 - StoreRequest/UpdateRequest에 rendered_html 검증 추가 - WorkOrderService 검사문서/작업일지 생성 시 rendered_html 전달 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,7 @@ public function create(array $data): Document
|
||||
'status' => Document::STATUS_DRAFT,
|
||||
'linkable_type' => $data['linkable_type'] ?? null,
|
||||
'linkable_id' => $data['linkable_id'] ?? null,
|
||||
'rendered_html' => $data['rendered_html'] ?? null,
|
||||
'created_by' => $userId,
|
||||
'updated_by' => $userId,
|
||||
]);
|
||||
@@ -170,12 +171,16 @@ public function update(int $id, array $data): Document
|
||||
}
|
||||
|
||||
// 기본 정보 수정
|
||||
$document->fill([
|
||||
$updateFields = [
|
||||
'title' => $data['title'] ?? $document->title,
|
||||
'linkable_type' => $data['linkable_type'] ?? $document->linkable_type,
|
||||
'linkable_id' => $data['linkable_id'] ?? $document->linkable_id,
|
||||
'updated_by' => $userId,
|
||||
]);
|
||||
];
|
||||
if (isset($data['rendered_html'])) {
|
||||
$updateFields['rendered_html'] = $data['rendered_html'];
|
||||
}
|
||||
$document->fill($updateFields);
|
||||
|
||||
// 반려 상태에서 수정 시 DRAFT로 변경
|
||||
if ($document->status === Document::STATUS_REJECTED) {
|
||||
|
||||
Reference in New Issue
Block a user