scheduleItem->schedule?->contract; $remaining = (float) $this->scheduleItem->remaining_amount; return [ 'title' => 'Cảnh báo đợt thanh toán sắp đến hạn', 'message' => sprintf( 'HĐ %s - Đợt %d (%s) sẽ đến hạn vào %s. Còn thiếu: %s VNĐ.', $contract?->contract_number ?? 'N/A', $this->scheduleItem->installment_no, $this->scheduleItem->type?->getLabel() ?? 'N/A', $this->scheduleItem->due_date?->format('d/m/Y') ?? 'N/A', number_format($remaining) ), 'contract_id' => $contract?->id, 'schedule_item_id' => $this->scheduleItem->id, 'due_date' => $this->scheduleItem->due_date?->toDateString(), 'remaining_amount' => $remaining, ]; } }