<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

/**
 * Alias ke wa:send-daily-recap agar path lama tetap berfungsi.
 */
class SendWhatsAppDailySummaryCommand extends Command
{
    protected $signature = 'whatsapp:send-daily-summary {--date= : Tanggal rekap (YYYY-MM-DD)} {--force : Paksa pengiriman meski hari libur}';

    protected $description = 'Alias: generate Alpha + kirim rekap WA harian (sama dengan wa:send-daily-recap)';

    public function handle(): int
    {
        $params = ['--force' => true];
        if ($this->option('date')) {
            $params['--date'] = $this->option('date');
        }
        if ($this->option('force')) {
            $params['--force'] = true;
        }

        return $this->call('wa:send-daily-recap', $params);
    }
}
