1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace DalliSDK\Requests\Act\TransferMoney; |
6
|
|
|
|
7
|
|
|
use DalliSDK\Requests\AbstractRequest; |
8
|
|
|
use DalliSDK\Requests\RequestInterface; |
9
|
|
|
use DalliSDK\Responses\Act\TransferMoney\ActTransferMoneyResponse; |
10
|
|
|
use JMS\Serializer\Annotation as JMS; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Запрос файла акта передачи денег |
14
|
|
|
* |
15
|
|
|
* @see https://api.dalli-service.com/v1/doc/moneyTransfers |
16
|
|
|
* @JMS\XmlRoot("moneyTransfers") |
17
|
|
|
*/ |
18
|
|
|
class ActTransferMoneyRequest extends AbstractRequest implements RequestInterface |
19
|
|
|
{ |
20
|
|
|
public const RESPONSE_CLASS = ActTransferMoneyResponse::class; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Дата, с которой начать поиск (обязательный элемент) |
24
|
|
|
* |
25
|
|
|
* @JMS\Type("DateTime<'Y-m-d'>") |
26
|
|
|
* @JMS\SerializedName("from") |
27
|
|
|
*/ |
28
|
|
|
private \DateTimeInterface $from; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Дата, по которую вести поиск (по умолчанию "сегодня") |
32
|
|
|
* |
33
|
|
|
* @JMS\Type("DateTime<'Y-m-d'>") |
34
|
|
|
* @JMS\SerializedName("to") |
35
|
|
|
*/ |
36
|
|
|
private \DateTimeInterface $to; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* JSON|XML меняет формат ответа (по умолчанию "XML") |
40
|
|
|
* |
41
|
|
|
* @JMS\Type("string") |
42
|
|
|
* @JMS\SerializedName("output") |
43
|
|
|
*/ |
44
|
|
|
private string $output = 'XML'; |
|
|
|
|
45
|
|
|
|
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @param \DateTimeInterface $from |
49
|
|
|
* @param \DateTimeInterface $to |
50
|
|
|
*/ |
51
|
1 |
|
public function __construct(\DateTimeInterface $from, \DateTimeInterface $to) |
52
|
|
|
{ |
53
|
1 |
|
$this->from = $from; |
54
|
1 |
|
$this->to = $to; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @return \DateTimeInterface |
59
|
|
|
*/ |
60
|
1 |
|
public function getFrom(): \DateTimeInterface |
61
|
|
|
{ |
62
|
1 |
|
return $this->from; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @param \DateTimeInterface $from |
67
|
|
|
* |
68
|
|
|
* @return ActTransferMoneyRequest |
69
|
|
|
*/ |
70
|
1 |
|
public function setFrom(\DateTimeInterface $from): ActTransferMoneyRequest |
71
|
|
|
{ |
72
|
1 |
|
$this->from = $from; |
73
|
1 |
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return \DateTimeInterface |
78
|
|
|
*/ |
79
|
1 |
|
public function getTo(): \DateTimeInterface |
80
|
|
|
{ |
81
|
1 |
|
return $this->to; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param \DateTimeInterface $to |
86
|
|
|
* |
87
|
|
|
* @return ActTransferMoneyRequest |
88
|
|
|
*/ |
89
|
1 |
|
public function setTo(\DateTimeInterface $to): ActTransferMoneyRequest |
90
|
|
|
{ |
91
|
1 |
|
$this->to = $to; |
92
|
1 |
|
return $this; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
|