Skip to content

Commit

Permalink
Se eliminan las opciones persistentes en servicios, deben ser pasadas…
Browse files Browse the repository at this point in the history
… a los métodos de los servicios. Se reordena el componente billing.integration dejando solo al SiiLazyWorkers con diferentes trabajos que puede realizar.
  • Loading branch information
estebandelaf committed Feb 1, 2025
1 parent 9d79d3f commit 4bb85ef
Show file tree
Hide file tree
Showing 77 changed files with 2,063 additions and 1,933 deletions.
136 changes: 68 additions & 68 deletions composer.lock

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,6 @@ services:
# Workers del componente "billing.integration".
libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiLazyWorkerInterface:
class: libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazyWorker
libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiWsdlConsumerWorkerInterface:
class: libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiWsdlConsumerWorker
libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiTokenManagerWorkerInterface:
class: libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiTokenManagerWorker
libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiDocumentSenderWorkerInterface:
class: libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiDocumentSenderWorker
libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiDeliveryCheckerWorkerInterface:
class: libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiDeliveryCheckerWorker
libredte\lib\Core\Package\Billing\Component\Integration\Contract\SiiDocumentValidatorWorkerInterface:
class: libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiDocumentValidatorWorker

# Workers del componente "billing.trading_parties".
libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\MandatarioManagerWorkerInterface:
Expand Down Expand Up @@ -285,6 +275,15 @@ services:
libredte\lib\Core\Package\Billing\Component\Identifier\Contract\CafProviderInterface:
class: libredte\lib\Core\Package\Billing\Component\Identifier\Service\FakeCafProvider

# Trabajos del worker "billing.integration.sii_lazy"
libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazy\Job\AuthenticateJob: ~
libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazy\Job\CheckXmlDocumentSentStatusJob: ~
libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazy\Job\ConsumeWebserviceJob: ~
libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazy\Job\RequestXmlDocumentSentStatusByEmailJob: ~
libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazy\Job\SendXmlDocumentJob: ~
libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazy\Job\ValidateDocumentJob: ~
libredte\lib\Core\Package\Billing\Component\Integration\Worker\SiiLazy\Job\ValidateDocumentSignatureJob: ~

# Workers del componente "prime.entity".
Derafu\Lib\Core\Package\Prime\Component\Entity\Contract\DatasourceProviderWorkerInterface:
class: Derafu\Lib\Core\Package\Prime\Component\Entity\Worker\DatasourceProviderWorker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

namespace libredte\lib\Core\Package\Billing\Component\Document\Contract;

use Derafu\Lib\Core\Common\Contract\OptionsAwareInterface;
use Derafu\Lib\Core\Package\Prime\Component\Certificate\Contract\CertificateInterface;
use Derafu\Lib\Core\Package\Prime\Component\Xml\Contract\XmlInterface;
use Derafu\Lib\Core\Support\Store\Contract\DataContainerInterface;
use libredte\lib\Core\Package\Billing\Component\Identifier\Contract\CafInterface;
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\EmisorInterface;
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\ReceptorInterface;
Expand All @@ -35,7 +35,7 @@
/**
* Interfaz para el contenedor de un documento.
*/
interface DocumentBagInterface
interface DocumentBagInterface extends OptionsAwareInterface
{
/**
* Asignar los datos de entrada del documento.
Expand Down Expand Up @@ -101,21 +101,6 @@ public function setLibredteData(?array $libredteData): static;
*/
public function getLibredteData(): ?array;

/**
* Asigna las opciones del documento.
*
* @param array|DataContainerInterface|null $options
* @return static
*/
public function setOptions(array|DataContainerInterface|null $options): static;

/**
* Obtiene las opciones del documento.
*
* @return DataContainerInterface|null
*/
public function getOptions(): ?DataContainerInterface;

/**
* Obtiene las opciones del procesador (parser) del documento.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

namespace libredte\lib\Core\Package\Billing\Component\Document\Contract;

use Derafu\Lib\Core\Common\Contract\OptionsAwareInterface;
use Derafu\Lib\Core\Package\Prime\Component\Certificate\Contract\CertificateInterface;
use Derafu\Lib\Core\Support\Store\Contract\DataContainerInterface;
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\EmisorInterface;

/**
* Interfaz para el contenedor de varios documentos que se procesarán en lote.
*/
interface DocumentBatchInterface
interface DocumentBatchInterface extends OptionsAwareInterface
{
/**
* Entrega la ruta del archivo con documentos que se debe procesar.
Expand All @@ -40,21 +40,6 @@ interface DocumentBatchInterface
*/
public function getFile(): string;

/**
* Asigna las opciones del procesamiento en lote de documentos.
*
* @param array|DataContainerInterface|null $options
* @return static
*/
public function setOptions(array|DataContainerInterface|null $options): static;

/**
* Obtiene las opciones del procesamiento en lote de documentos.
*
* @return DataContainerInterface|null
*/
public function getOptions(): ?DataContainerInterface;

/**
* Asigna el emisor del documento.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ public function getValidatorWorker(): ValidatorWorkerInterface;
* @param string|array|stdClass $data
* @param string|CafInterface|null $caf
* @param string|array|CertificateInterface|null $certificate
* @param array|DataContainerInterface|null $options
* @param array|DataContainerInterface $options
* @return DocumentBagInterface
*/
public function bill(
string|array|stdClass $data,
string|CafInterface $caf = null,
string|array|CertificateInterface $certificate = null,
array|DataContainerInterface $options = null
array|DataContainerInterface $options = []
): DocumentBagInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

namespace libredte\lib\Core\Package\Billing\Component\Document\Contract;

use Derafu\Lib\Core\Common\Contract\OptionsAwareInterface;
use Derafu\Lib\Core\Package\Prime\Component\Certificate\Contract\CertificateInterface;
use Derafu\Lib\Core\Package\Prime\Component\Xml\Contract\XmlInterface;
use Derafu\Lib\Core\Support\Store\Contract\DataContainerInterface;
use libredte\lib\Core\Package\Billing\Component\Document\Enum\TipoSobre;
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\EmisorInterface;
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\MandatarioInterface;
Expand All @@ -36,7 +36,7 @@
* Interfaz para el sobre (contenedor) de documentos tributarios para el proceso
* de envío al SII e intercambio entre contribuyentes.
*/
interface DocumentEnvelopeInterface
interface DocumentEnvelopeInterface extends OptionsAwareInterface
{
/**
* Entrega el identificador del sobre de documentos.
Expand Down Expand Up @@ -105,21 +105,6 @@ public function getDocuments(): ?array;
*/
public function addDocument(DocumentBagInterface $document): static;

/**
* Asigna las opciones del sobre de documentos.
*
* @param array|DataContainerInterface|null $options
* @return static
*/
public function setOptions(array|DataContainerInterface|null $options): static;

/**
* Obtiene las opciones del sobre de documentos.
*
* @return DataContainerInterface|null
*/
public function getOptions(): ?DataContainerInterface;

/**
* Obtiene las opciones del despachador del sobre de documentos al SII.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function getMoneda(): string;
* Se puede solicitar todo el detalle o el detalle de una línea en
* específico.
*
* @param integer|null $index Índice de la línea de detalle solicitada o
* @param int|null $index Índice de la línea de detalle solicitada o
* `null` (por defecto) para obtener todas las líneas.
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,28 @@ public function getCategoria(): ?CategoriaDocumento;
/**
* Indica si el documento es electrónico o no.
*
* @return boolean|null
* @return bool|null
*/
public function esElectronico(): ?bool;

/**
* Indica si un documento que es electrónico se debe enviar al SII.
*
* @return boolean|null
* @return bool|null
*/
public function seEnviaAlSii(): ?bool;

/**
* Indica si el documento puede ser utilizado en compras de la empresa.
*
* @return boolean|null
* @return bool|null
*/
public function disponibleEnCompras(): ?bool;

/**
* Indica si el documento puede ser utilizado en ventas de la empresa.
*
* @return boolean|null
* @return bool|null
*/
public function disponibleEnVentas(): ?bool;

Expand Down Expand Up @@ -128,7 +128,7 @@ public function getTagXml(): ?TagXmlDocumento;
/**
* Indica si el documento está disponible en LibreDTE para ser usado.
*
* @return boolean
* @return bool
*/
public function estaDisponible(): bool;

Expand Down Expand Up @@ -164,28 +164,28 @@ public function getTipoSobre(): ?TipoSobre;
/**
* Indica si el documento es de tipo guía de despacho.
*
* @return boolean
* @return bool
*/
public function esGuiaDespacho(): bool;

/**
* Indica si el documento es de tipo boleta.
*
* @return boolean
* @return bool
*/
public function esBoleta(): bool;

/**
* Indica si el documento es de exportación.
*
* @return boolean
* @return bool
*/
public function esExportacion(): bool;

/**
* Indica si el documento es exento.
*
* @return boolean
* @return bool
*/
public function esExento(): bool;

Expand All @@ -198,7 +198,7 @@ public function esExento(): bool;
/**
* Indica si el documento requiere el tag "TpoTranVenta" en el XML.
*
* @return boolean
* @return bool
*/
public function requiereTpoTranVenta(): bool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function bill(
string|array|stdClass $data,
string|CafInterface $caf = null,
string|array|CertificateInterface $certificate = null,
array|DataContainerInterface $options = null
array|DataContainerInterface $options = []
): DocumentBagInterface {
// Si el CAF es un string se debe construir el CAF.
if (is_string($caf)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class TipoDocumento extends Entity implements TipoDocumentoInterface
/**
* Indica si el documento está disponible para ser emitido en LibreDTE.
*
* @var boolean
* @var bool
*/
private bool $disponible = false;

Expand Down Expand Up @@ -172,7 +172,7 @@ class TipoDocumento extends Entity implements TipoDocumentoInterface
/**
* Contructor del tipo de documento.
*
* @param integer|string $codigo
* @param int|string $codigo
* @param string $nombre
* @param string|null $nombre_corto
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class BatchProcessorException extends DocumentException
* Constructor de la excepción.
*
* @param string $message
* @param integer $code
* @param int $code
* @param Throwable|null $previous
* @param DocumentBatchInterface|null $documentBatch
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DocumentException extends BillingException
* Constructor de la excepción.
*
* @param string $message
* @param integer $code
* @param int $code
* @param Throwable|null $previous
* @param DocumentBagInterface|null $documentBag
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
use libredte\lib\Core\Package\Billing\Component\Document\Entity\AduanaTransporte;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\Comuna;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\FormaPago;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\FormaPagoExportacion;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\ImpuestoAdicionalRetencion;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\MedioPago;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\FormaPagoExportacion;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\TagXml;
use libredte\lib\Core\Package\Billing\Component\Document\Entity\Traslado;
use TCPDF2DBarcode;
Expand Down
Loading

0 comments on commit 4bb85ef

Please sign in to comment.