feat(API): 작업일지 생성/조회 API 추가
- WorkOrderService: getWorkLogTemplate, getWorkLog, createWorkLog 메서드 추가 - WorkOrderController: 작업일지 3개 엔드포인트 추가 - 라우트: GET work-log-template, GET/POST work-log - WorkOrder 모델: documents() MorphMany 관계 추가 - i18n: work_log_saved, no_work_log_template 메시지 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -258,4 +258,34 @@ public function createInspectionDocument(Request $request, int $id)
|
||||
return $this->service->createInspectionDocument($id, $request->all());
|
||||
}, __('message.work_order.inspection_document_created'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 작업일지 양식 템플릿 조회
|
||||
*/
|
||||
public function workLogTemplate(int $id)
|
||||
{
|
||||
return ApiResponse::handle(function () use ($id) {
|
||||
return $this->service->getWorkLogTemplate($id);
|
||||
}, __('message.work_order.fetched'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 작업일지 조회 (기존 문서 + 템플릿 + 통계)
|
||||
*/
|
||||
public function workLog(int $id)
|
||||
{
|
||||
return ApiResponse::handle(function () use ($id) {
|
||||
return $this->service->getWorkLog($id);
|
||||
}, __('message.work_order.fetched'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 작업일지 생성/수정
|
||||
*/
|
||||
public function createWorkLog(Request $request, int $id)
|
||||
{
|
||||
return ApiResponse::handle(function () use ($request, $id) {
|
||||
return $this->service->createWorkLog($id, $request->all());
|
||||
}, __('message.work_order.work_log_saved'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user