feat:자금계획일정 월별 복사 기능 추가
- POST /api/admin/fund-schedules/copy 엔드포인트 추가 - FundScheduleService에 copySchedulesToMonth() 메서드 추가 - 월 네비게이션 옆 일정복사 버튼 및 모달 UI 구현 - 날짜 조정 로직 (31일→28/29/30일) 포함 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -239,6 +239,47 @@ public function updateStatus(Request $request, int $id): JsonResponse|Response
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 월별 일정 복사
|
||||
*/
|
||||
public function copy(Request $request): JsonResponse
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'source_year' => 'required|integer|min:2000|max:2100',
|
||||
'source_month' => 'required|integer|min:1|max:12',
|
||||
'target_year' => 'required|integer|min:2000|max:2100',
|
||||
'target_month' => 'required|integer|min:1|max:12',
|
||||
]);
|
||||
|
||||
if ($validated['source_year'] === $validated['target_year']
|
||||
&& $validated['source_month'] === $validated['target_month']) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '원본 월과 대상 월이 동일합니다.',
|
||||
], 422);
|
||||
}
|
||||
|
||||
$copiedCount = $this->fundScheduleService->copySchedulesToMonth(
|
||||
$validated['source_year'],
|
||||
$validated['source_month'],
|
||||
$validated['target_year'],
|
||||
$validated['target_month']
|
||||
);
|
||||
|
||||
if ($copiedCount === 0) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '복사할 일정이 없습니다.',
|
||||
], 422);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => "{$copiedCount}건의 일정이 복사되었습니다.",
|
||||
'data' => ['copied_count' => $copiedCount],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 월별 요약 통계
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user