diff --git a/cli/common/Alias/Command.php b/cli/common/Alias/Command.php new file mode 100644 index 0000000..bce5031 --- /dev/null +++ b/cli/common/Alias/Command.php @@ -0,0 +1,14 @@ +logger->debug("Running {$this->getName()}"); $uri = '/api/direcciones/region/13/comunas'; $output->writeln("GET {$uri}"); $response = $this->client->get($uri); diff --git a/cli/src/Command/Money/IPC.php b/cli/src/Command/Money/IPC.php index 06d29c4..081dd36 100644 --- a/cli/src/Command/Money/IPC.php +++ b/cli/src/Command/Money/IPC.php @@ -3,21 +3,17 @@ namespace Incoviba\Command\Money; use DateTimeImmutable; use DateInterval; -use Psr\Http\Client\ClientInterface; use Symfony\Component\Console; +use Incoviba\Common\Alias\Command; #[Console\Attribute\AsCommand( name: 'money:ipc' )] -class IPC extends Console\Command\Command +class IPC extends Command { - public function __construct(protected ClientInterface $client, string $name = null) - { - parent::__construct($name); - } - public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { + $this->logger->debug("Running {$this->getName()}"); $lastMonth = (new DateTimeImmutable())->sub(new DateInterval('P1M')); $uri = '/api/money'; $data = [ diff --git a/cli/src/Command/Money/UF.php b/cli/src/Command/Money/UF.php index 109c96f..b7c99e2 100644 --- a/cli/src/Command/Money/UF.php +++ b/cli/src/Command/Money/UF.php @@ -2,21 +2,17 @@ namespace Incoviba\Command\Money; use DateTimeImmutable; -use Psr\Http\Client\ClientInterface; use Symfony\Component\Console; +use Incoviba\Common\Alias\Command; #[Console\Attribute\AsCommand( name: 'money:uf' )] -class UF extends Console\Command\Command +class UF extends Command { - public function __construct(protected ClientInterface $client, string $name = null) - { - parent::__construct($name); - } - public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output) { + $this->logger->debug("Running {$this->getName()}"); $now = new DateTimeImmutable(); $uri = '/api/money'; $data = [ diff --git a/cli/src/Command/Proyectos/Activos.php b/cli/src/Command/Proyectos/Activos.php index 80113c1..a3d941a 100644 --- a/cli/src/Command/Proyectos/Activos.php +++ b/cli/src/Command/Proyectos/Activos.php @@ -1,21 +1,17 @@ logger->debug("Running {$this->getName()}"); $uri = '/api/proyectos'; $output->writeln("GET {$uri}"); $response = $this->client->get($uri); diff --git a/cli/src/Command/Ventas/Cierres/Vigentes.php b/cli/src/Command/Ventas/Cierres/Vigentes.php index ca65e36..0ee10cc 100644 --- a/cli/src/Command/Ventas/Cierres/Vigentes.php +++ b/cli/src/Command/Ventas/Cierres/Vigentes.php @@ -1,21 +1,17 @@ logger->debug("Running {$this->getName()}"); $uri = '/api/ventas/cierres/vigentes'; $output->writeln("GET {$uri}"); $response = $this->client->get($uri); diff --git a/cli/src/Command/Ventas/Cuotas/Hoy.php b/cli/src/Command/Ventas/Cuotas/Hoy.php index de6ccf6..3fa17c2 100644 --- a/cli/src/Command/Ventas/Cuotas/Hoy.php +++ b/cli/src/Command/Ventas/Cuotas/Hoy.php @@ -1,21 +1,17 @@ logger->debug("Running {$this->getName()}"); $uri = '/api/ventas/cuotas/hoy'; $output->writeln("GET {$uri}"); $response = $this->client->get($uri); diff --git a/cli/src/Command/Ventas/Cuotas/Pendientes.php b/cli/src/Command/Ventas/Cuotas/Pendientes.php index ddc8a62..05f1d0f 100644 --- a/cli/src/Command/Ventas/Cuotas/Pendientes.php +++ b/cli/src/Command/Ventas/Cuotas/Pendientes.php @@ -1,21 +1,17 @@ logger->debug("Running {$this->getName()}"); $uri = '/api/ventas/cuotas/pendientes'; $output->writeln("GET {$uri}"); $response = $this->client->get($uri); diff --git a/cli/src/Command/Ventas/Cuotas/PorVencer.php b/cli/src/Command/Ventas/Cuotas/PorVencer.php index 2938945..30849b3 100644 --- a/cli/src/Command/Ventas/Cuotas/PorVencer.php +++ b/cli/src/Command/Ventas/Cuotas/PorVencer.php @@ -1,21 +1,17 @@ logger->debug("Running {$this->getName()}"); $uri = '/api/ventas/cuotas/vencer'; $output->writeln("GET {$uri}"); $response = $this->client->get($uri);