|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* LibreDTE: Biblioteca PHP (Núcleo). |
|
7
|
|
|
* Copyright (C) LibreDTE <https://www.libredte.cl> |
|
8
|
|
|
* |
|
9
|
|
|
* Este programa es software libre: usted puede redistribuirlo y/o modificarlo |
|
10
|
|
|
* bajo los términos de la Licencia Pública General Affero de GNU publicada por |
|
11
|
|
|
* la Fundación para el Software Libre, ya sea la versión 3 de la Licencia, o |
|
12
|
|
|
* (a su elección) cualquier versión posterior de la misma. |
|
13
|
|
|
* |
|
14
|
|
|
* Este programa se distribuye con la esperanza de que sea útil, pero SIN |
|
15
|
|
|
* GARANTÍA ALGUNA; ni siquiera la garantía implícita MERCANTIL o de APTITUD |
|
16
|
|
|
* PARA UN PROPÓSITO DETERMINADO. Consulte los detalles de la Licencia Pública |
|
17
|
|
|
* General Affero de GNU para obtener una información más detallada. |
|
18
|
|
|
* |
|
19
|
|
|
* Debería haber recibido una copia de la Licencia Pública General Affero de |
|
20
|
|
|
* GNU junto a este programa. |
|
21
|
|
|
* |
|
22
|
|
|
* En caso contrario, consulte <http://www.gnu.org/licenses/agpl.html>. |
|
23
|
|
|
*/ |
|
24
|
|
|
|
|
25
|
|
|
namespace libredte\lib\Core\Package\Billing; |
|
26
|
|
|
|
|
27
|
|
|
use Derafu\Lib\Core\Foundation\Abstract\AbstractPackage; |
|
28
|
|
|
use libredte\lib\Core\Package\Billing\Component\Book\Contract\BookComponentInterface; |
|
29
|
|
|
use libredte\lib\Core\Package\Billing\Component\Document\Contract\DocumentComponentInterface; |
|
30
|
|
|
use libredte\lib\Core\Package\Billing\Component\Identifier\Contract\IdentifierComponentInterface; |
|
31
|
|
|
use libredte\lib\Core\Package\Billing\Component\Integration\Contract\IntegrationComponentInterface; |
|
32
|
|
|
use libredte\lib\Core\Package\Billing\Component\OwnershipTransfer\Contract\OwnershipTransferComponentInterface; |
|
33
|
|
|
use libredte\lib\Core\Package\Billing\Component\TradingParties\Contract\TradingPartiesComponentInterface; |
|
34
|
|
|
use libredte\lib\Core\Package\Billing\Contract\BillingPackageInterface; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Paquete de facturación: "billing". |
|
38
|
|
|
*/ |
|
39
|
|
|
class BillingPackage extends AbstractPackage implements BillingPackageInterface |
|
40
|
|
|
{ |
|
41
|
79 |
|
public function __construct( |
|
42
|
|
|
private BookComponentInterface $bookComponent, |
|
43
|
|
|
private DocumentComponentInterface $documentComponent, |
|
44
|
|
|
private IdentifierComponentInterface $identifierComponent, |
|
45
|
|
|
private IntegrationComponentInterface $integrationComponent, |
|
46
|
|
|
private OwnershipTransferComponentInterface $ownershipTransferComponent, |
|
47
|
|
|
private TradingPartiesComponentInterface $tradingPartiesComponent |
|
48
|
|
|
) { |
|
49
|
79 |
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* {@inheritdoc} |
|
53
|
|
|
*/ |
|
54
|
|
|
public function getComponents(): array |
|
55
|
|
|
{ |
|
56
|
|
|
return [ |
|
57
|
|
|
'book' => $this->bookComponent, |
|
58
|
|
|
'document' => $this->documentComponent, |
|
59
|
|
|
'identifier' => $this->identifierComponent, |
|
60
|
|
|
'integration' => $this->integrationComponent, |
|
61
|
|
|
'ownership_transfer' => $this->ownershipTransferComponent, |
|
62
|
|
|
'trading_parties' => $this->tradingPartiesComponent, |
|
63
|
|
|
]; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* {@inheritdoc} |
|
68
|
|
|
*/ |
|
69
|
|
|
public function getBookComponent(): BookComponentInterface |
|
70
|
|
|
{ |
|
71
|
|
|
return $this->bookComponent; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* {@inheritdoc} |
|
76
|
|
|
*/ |
|
77
|
73 |
|
public function getDocumentComponent(): DocumentComponentInterface |
|
78
|
|
|
{ |
|
79
|
73 |
|
return $this->documentComponent; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* {@inheritdoc} |
|
84
|
|
|
*/ |
|
85
|
59 |
|
public function getIdentifierComponent(): IdentifierComponentInterface |
|
86
|
|
|
{ |
|
87
|
59 |
|
return $this->identifierComponent; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* {@inheritdoc} |
|
92
|
|
|
*/ |
|
93
|
1 |
|
public function getIntegrationComponent(): IntegrationComponentInterface |
|
94
|
|
|
{ |
|
95
|
1 |
|
return $this->integrationComponent; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* {@inheritdoc} |
|
100
|
|
|
*/ |
|
101
|
|
|
public function getOwnershipTransferComponent(): OwnershipTransferComponentInterface |
|
102
|
|
|
{ |
|
103
|
|
|
return $this->ownershipTransferComponent; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* {@inheritdoc} |
|
108
|
|
|
*/ |
|
109
|
|
|
public function getTradingPartiesComponent(): TradingPartiesComponentInterface |
|
110
|
|
|
{ |
|
111
|
|
|
return $this->tradingPartiesComponent; |
|
112
|
|
|
} |
|
113
|
|
|
} |
|
114
|
|
|
|