|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace VasilDakov\Speedy\Service\Calculation; |
|
6
|
|
|
|
|
7
|
|
|
use JMS\Serializer\Annotation as Serializer; |
|
8
|
|
|
use VasilDakov\Speedy\Property; |
|
9
|
|
|
use VasilDakov\Speedy\Speedy; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Class CalculationRequest. |
|
13
|
|
|
* |
|
14
|
|
|
* @Serializer\AccessType("public_method") |
|
15
|
|
|
* |
|
16
|
|
|
* @author Vasil Dakov <[email protected]> |
|
17
|
|
|
* @copyright 2009-2022 Neutrino.bg |
|
18
|
|
|
* |
|
19
|
|
|
* @version 1.0 |
|
20
|
|
|
*/ |
|
21
|
|
|
class CalculationRequest |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Calculation\CalculationSender") |
|
25
|
|
|
*/ |
|
26
|
|
|
private CalculationSender $sender; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Calculation\CalculationRecipient") |
|
30
|
|
|
*/ |
|
31
|
|
|
private CalculationRecipient $recipient; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Calculation\CalculationService") |
|
35
|
|
|
*/ |
|
36
|
|
|
private CalculationService $service; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Calculation\CalculationContent") |
|
40
|
|
|
*/ |
|
41
|
|
|
private CalculationContent $content; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @Serializer\Type("VasilDakov\Speedy\Service\Calculation\CalculationPayment") |
|
45
|
|
|
*/ |
|
46
|
|
|
private CalculationPayment $payment; |
|
47
|
|
|
|
|
48
|
1 |
|
public function getSender(): CalculationSender |
|
49
|
|
|
{ |
|
50
|
1 |
|
return $this->sender; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
1 |
|
public function setSender(CalculationSender $sender): void |
|
54
|
|
|
{ |
|
55
|
1 |
|
$this->sender = $sender; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
1 |
|
public function getRecipient(): CalculationRecipient |
|
59
|
|
|
{ |
|
60
|
1 |
|
return $this->recipient; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
1 |
|
public function setRecipient(CalculationRecipient $recipient): void |
|
64
|
|
|
{ |
|
65
|
1 |
|
$this->recipient = $recipient; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
1 |
|
public function getService(): CalculationService |
|
69
|
|
|
{ |
|
70
|
1 |
|
return $this->service; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
1 |
|
public function setService(CalculationService $service): void |
|
74
|
|
|
{ |
|
75
|
1 |
|
$this->service = $service; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
1 |
|
public function getContent(): CalculationContent |
|
79
|
|
|
{ |
|
80
|
1 |
|
return $this->content; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
1 |
|
public function setContent(CalculationContent $content): void |
|
84
|
|
|
{ |
|
85
|
1 |
|
$this->content = $content; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
1 |
|
public function getPayment(): CalculationPayment |
|
89
|
|
|
{ |
|
90
|
1 |
|
return $this->payment; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
1 |
|
public function setPayment(CalculationPayment $payment): void |
|
94
|
|
|
{ |
|
95
|
1 |
|
$this->payment = $payment; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
1 |
|
public function toArray(): array |
|
99
|
|
|
{ |
|
100
|
1 |
|
return [ |
|
101
|
1 |
|
Property::SENDER->value => $this->sender->toArray(), |
|
102
|
1 |
|
Property::RECIPIENT->value => $this->recipient->toArray(), |
|
103
|
1 |
|
Property::SERVICE->value => $this->service->toArray(), |
|
104
|
1 |
|
Property::CONTENT->value => $this->content->toArray(), |
|
105
|
1 |
|
Property::PAYMENT->value => $this->payment->toArray(), |
|
106
|
1 |
|
]; |
|
107
|
|
|
} |
|
108
|
|
|
} |
|
109
|
|
|
|