info('Starting ATM Transaction report generation...'); $period = $this->option('period'); if (!$period) { $this->error('Period parameter is required. Format: Ymd (example: 20250512)'); return Command::FAILURE; } // Validate period format if (!preg_match('/^\d{8}$/', $period)) { $this->error('Invalid period format. Use Ymd format (example: 20250512)'); return Command::FAILURE; } try { // Dispatch the job GenerateAtmTransactionReportJob::dispatch($period); $this->info("ATM Transaction report generation job queued for period: {$period}"); $this->info('The report will be generated in the background.'); return Command::SUCCESS; } catch (Exception $e) { $this->error('Error queuing ATM Transaction report job: ' . $e->getMessage()); return Command::FAILURE; } } }