$this->service->getAll(), ]); } public function current(): RedirectResponse { $now = now(); $period = PayrollPeriod::firstOrCreate( ['year' => $now->year, 'month' => $now->month], ['status' => PayrollPeriodStatus::OPEN] ); return to_route('admin.finance.payroll-periods.show', ['payroll_period' => $period->id]); } public function show(PayrollPeriod $payrollPeriod): Response { $period = $this->service->getDetail($payrollPeriod); return Inertia::render('admin/finance/payroll-period/show', [ 'payrollPeriod' => $period, ]); } public function close(PayrollPeriod $payrollPeriod): RedirectResponse { return $this->handleAction( fn () => $this->service->close($payrollPeriod), 'Periode gaji berhasil ditutup.', 'admin.finance.payroll-periods.index' ); } public function reopen(PayrollPeriod $payrollPeriod): RedirectResponse { return $this->handleAction( fn () => $this->service->reopen($payrollPeriod), 'Periode gaji berhasil dibuka kembali.', 'admin.finance.payroll-periods.index' ); } }