feat:개발 진행중 → 승인대기로 이동 기능 추가

- revertToPending 서비스 메서드 추가
- revertToPending 컨트롤러 액션 추가
- /approvals/{id}/revert-pending 라우트 추가
- progress-list에 "승인대기로" 버튼 추가
- JavaScript revertToPending 함수 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-01-31 20:33:44 +09:00
parent e993eb5a0a
commit 28f129393d
5 changed files with 100 additions and 2 deletions

View File

@@ -202,6 +202,30 @@ public function updateHqStatus(int $id, string $status): SalesTenantManagement
return $management->fresh();
}
/**
* 승인대기로 되돌리기 (진행중 → pending)
*/
public function revertToPending(int $id): SalesTenantManagement
{
$management = SalesTenantManagement::findOrFail($id);
// 이미 pending 상태인 경우
if ($management->hq_status === SalesTenantManagement::HQ_STATUS_PENDING) {
throw new \InvalidArgumentException('이미 승인대기 상태입니다.');
}
// handover(인계) 상태에서는 되돌리기 불가
if ($management->hq_status === SalesTenantManagement::HQ_STATUS_HANDOVER) {
throw new \InvalidArgumentException('인계 완료된 항목은 되돌릴 수 없습니다.');
}
$management->update([
'hq_status' => SalesTenantManagement::HQ_STATUS_PENDING,
]);
return $management->fresh();
}
/**
* 상세 정보 조회
*/