netgescon-day0/app/Console/Commands/GesconEnrichStabile.php

27 lines
792 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Services\GesconImport\StabileEnrichmentService;
class GesconEnrichStabile extends Command
{
protected $signature = 'gescon:enrich-stabile {--stabile=} {--path=/mnt/gescon-archives/gescon}';
protected $description = 'Arricchisce un singolo stabile con dati catasto/banca da Stabili.mdb';
public function handle(): int
{
$code = $this->option('stabile');
if (!$code) {
$this->error('Specificare --stabile=CODICE');
return 1;
}
$path = $this->option('path');
$svc = new StabileEnrichmentService();
$res = $svc->enrich($code, $path);
$this->info('Enrichment eseguito: ' . json_encode($res));
return 0;
}
}