<?php

namespace App\Console\Commands\Backoffice;

use App\Services\Backoffice\BackofficeService;
use Illuminate\Console\Command;

class UpdateUris extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'backoffice:update-uris {contentType?}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Update the URIs of all content types or a specific one';

    /**
     * Execute the console command.
     */
    public function handle(BackofficeService $service)
    {
        $this->info('Starting URI update...');
        $contentType = $this->argument('contentType');
        $service->updateUris($contentType);
        $this->info('URIs updated successfully.');
        return 0;
    }
}
