- DepositIssueObserver, WithdrawalIssueObserver 신규 추가 - TodayIssueObserverService에 입금/출금 핸들러 및 디버그 로그 추가 - TodayIssue 모델에 입금/출금 상수 추가 - AppServiceProvider에 Observer 등록 - ApprovalService에 기존 결재선 사용 시 수동 알림 트리거 추가 - LoanController ApiResponse::handle() → ApiResponse::success() 수정 Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Observers\TodayIssue;
|
|
|
|
use App\Models\Tenants\Withdrawal;
|
|
use App\Services\TodayIssueObserverService;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
/**
|
|
* Withdrawal 모델의 TodayIssue Observer
|
|
*/
|
|
class WithdrawalIssueObserver
|
|
{
|
|
public function __construct(
|
|
protected TodayIssueObserverService $service
|
|
) {}
|
|
|
|
public function created(Withdrawal $withdrawal): void
|
|
{
|
|
Log::info('WithdrawalIssueObserver::created CALLED', [
|
|
'withdrawal_id' => $withdrawal->id,
|
|
'tenant_id' => $withdrawal->tenant_id,
|
|
]);
|
|
|
|
$this->safeExecute(fn () => $this->service->handleWithdrawalCreated($withdrawal));
|
|
}
|
|
|
|
public function deleted(Withdrawal $withdrawal): void
|
|
{
|
|
$this->safeExecute(fn () => $this->service->handleWithdrawalDeleted($withdrawal));
|
|
}
|
|
|
|
protected function safeExecute(callable $callback): void
|
|
{
|
|
try {
|
|
$callback();
|
|
} catch (\Throwable $e) {
|
|
Log::warning('TodayIssue WithdrawalObserver failed', [
|
|
'error' => $e->getMessage(),
|
|
]);
|
|
}
|
|
}
|
|
}
|