feat: [calendar,vat] 캘린더 CRUD 및 부가세 상세 조회 API 추가

- CalendarController/Service: 일정 등록/수정/삭제 API 추가
- VatController/Service: getDetail() 상세 조회 (요약, 참조테이블, 미발행 목록, 신고기간 옵션)
- 라우트: POST/PUT/DELETE /calendar/schedules, GET /vat/detail 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
유병철
2026-03-04 20:33:04 +09:00
parent 2f3ec13b24
commit 74a60e06bc
5 changed files with 275 additions and 0 deletions

View File

@@ -226,6 +226,78 @@ private function getLeaveSchedules(
});
}
/**
* 일정 등록
*/
public function createSchedule(array $data): array
{
$schedule = Schedule::create([
'tenant_id' => $this->tenantId(),
'title' => $data['title'],
'description' => $data['description'] ?? null,
'start_date' => $data['start_date'],
'end_date' => $data['end_date'],
'start_time' => $data['start_time'] ?? null,
'end_time' => $data['end_time'] ?? null,
'is_all_day' => $data['is_all_day'] ?? true,
'type' => Schedule::TYPE_EVENT,
'color' => $data['color'] ?? null,
'is_active' => true,
'created_by' => $this->apiUserId(),
]);
return [
'id' => $schedule->id,
'title' => $schedule->title,
'start_date' => $schedule->start_date?->format('Y-m-d'),
'end_date' => $schedule->end_date?->format('Y-m-d'),
];
}
/**
* 일정 수정
*/
public function updateSchedule(int $id, array $data): array
{
$schedule = Schedule::where('tenant_id', $this->tenantId())
->findOrFail($id);
$schedule->update([
'title' => $data['title'],
'description' => $data['description'] ?? null,
'start_date' => $data['start_date'],
'end_date' => $data['end_date'],
'start_time' => $data['start_time'] ?? null,
'end_time' => $data['end_time'] ?? null,
'is_all_day' => $data['is_all_day'] ?? true,
'color' => $data['color'] ?? null,
'updated_by' => $this->apiUserId(),
]);
return [
'id' => $schedule->id,
'title' => $schedule->title,
'start_date' => $schedule->start_date?->format('Y-m-d'),
'end_date' => $schedule->end_date?->format('Y-m-d'),
];
}
/**
* 일정 삭제 (소프트 삭제)
*/
public function deleteSchedule(int $id): array
{
$schedule = Schedule::where('tenant_id', $this->tenantId())
->findOrFail($id);
$schedule->update(['deleted_by' => $this->apiUserId()]);
$schedule->delete();
return [
'id' => $schedule->id,
];
}
/**
* 범용 일정 조회 (본사 공통 + 테넌트 일정)
*/