2021-11-01 11:00:59 -03:00
|
|
|
<?php
|
|
|
|
use Psr\Container\ContainerInterface as Container;
|
|
|
|
|
|
|
|
return [
|
|
|
|
GuzzleHttp\Client::class => function(Container $c) {
|
|
|
|
return new GuzzleHttp\Client();
|
|
|
|
},
|
2021-12-06 22:10:41 -03:00
|
|
|
Contabilidad\Common\Service\Auth::class => function(Container $c) {
|
|
|
|
return new Contabilidad\Common\Service\Auth($c->get('api_key'));
|
|
|
|
},
|
|
|
|
Contabilidad\Common\Middleware\Auth::class => function(Container $c) {
|
|
|
|
return new Contabilidad\Common\Middleware\Auth(
|
|
|
|
$c->get(Nyholm\Psr7\Factory\Psr17Factory::class),
|
|
|
|
$c->get(Contabilidad\Common\Service\Auth::class)
|
|
|
|
);
|
|
|
|
},
|
2021-11-01 11:00:59 -03:00
|
|
|
Contabilidad\Common\Service\PdfHandler::class => function(Container $c) {
|
|
|
|
return new Contabilidad\Common\Service\PdfHandler($c->get(GuzzleHttp\Client::class), $c->get('folders')->pdfs, implode('/', [
|
|
|
|
$c->get('urls')->python,
|
|
|
|
'pdf',
|
|
|
|
'parse'
|
|
|
|
]));
|
2021-12-06 22:10:41 -03:00
|
|
|
},
|
|
|
|
Contabilidad\Common\Service\CsvHandler::class => function(Container $c) {
|
|
|
|
return new Contabilidad\Common\Service\CsvHandler($c->get('folders')->csvs);
|
|
|
|
},
|
|
|
|
Contabilidad\Common\Service\XlsHandler::class => function(Container $c) {
|
|
|
|
return new Contabilidad\Common\Service\XlsHandler($c->get('folders')->xlss);
|
|
|
|
},
|
|
|
|
Contabilidad\Common\Service\DocumentHandler::class => function(Container $c) {
|
|
|
|
$handlers = [
|
|
|
|
$c->get(Contabilidad\Common\Service\XlsHandler::class),
|
|
|
|
$c->get(Contabilidad\Common\Service\CsvHandler::class),
|
|
|
|
$c->get(Contabilidad\Common\Service\PdfHandler::class)
|
|
|
|
];
|
|
|
|
return new Contabilidad\Common\Service\DocumentHandler($handlers);
|
|
|
|
},
|
|
|
|
Contabilidad\Common\Service\TiposCambios::class => function(Container $c) {
|
|
|
|
return new Contabilidad\Common\Service\TiposCambios(
|
|
|
|
$c->get(GuzzleHttp\Client::class),
|
|
|
|
$c->get(ProVM\Common\Factory\Model::class),
|
|
|
|
$c->get('python_api'),
|
|
|
|
$c->get('python_key')
|
|
|
|
);
|
|
|
|
}
|
2021-11-01 11:00:59 -03:00
|
|
|
];
|