1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace alekciy\ofd\providers\taxcom\Request; |
4
|
|
|
|
5
|
|
|
use alekciy\ofd\providers\taxcom\Model\Document; |
6
|
|
|
use alekciy\ofd\providers\taxcom\RequestPage; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Список документов по смене. |
10
|
|
|
*/ |
11
|
|
|
class DocumentList extends RequestPage |
12
|
|
|
{ |
13
|
|
|
public $method = 'GET'; |
14
|
|
|
protected $path = '/API/v2/DocumentList'; |
15
|
|
|
|
16
|
|
|
/** @var string Заводской номер ФН */ |
17
|
|
|
public $fnFactoryNumber = ''; |
18
|
|
|
|
19
|
|
|
/** @var int Номер смены */ |
20
|
|
|
public $shiftNumber = 0; |
21
|
|
|
|
22
|
|
|
/** @var integer[] Тип документа */ |
23
|
|
|
public $type = []; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @inheritDoc |
27
|
|
|
*/ |
28
|
|
|
public function getPropertyMap(): array |
29
|
|
|
{ |
30
|
|
|
return array_merge(parent::getPropertyMap(), [ |
31
|
|
|
'fnFactoryNumber' => ['query' => 'fn'], |
32
|
|
|
'shiftNumber' => ['query' => 'shift'], |
33
|
|
|
'type' => ['query' => 'type'], |
34
|
|
|
]); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @inheritDoc |
39
|
|
|
*/ |
40
|
|
|
public function getRuleList(): array |
41
|
|
|
{ |
42
|
|
|
return array_merge(parent::getRuleList(), [ |
43
|
|
|
'fnFactoryNumber' => ['required', ['lengthMin', 1], ['lengthMax', 16]], |
44
|
|
|
'shiftNumber' => ['required', 'integer', ['min', 0]], |
45
|
|
|
'type' => ['array', ['subset', [ |
46
|
|
|
Document::TYPE_CHECK, |
47
|
|
|
Document::TYPE_CLOSE, |
48
|
|
|
Document::TYPE_STATE, |
49
|
|
|
Document::TYPE_CHECK_CORRECT, |
50
|
|
|
Document::TYPE_STRICT, |
51
|
|
|
Document::TYPE_STRICT_CORRECT, |
52
|
|
|
Document::TYPE_OPEN, |
53
|
|
|
]]], |
54
|
|
|
]); |
55
|
|
|
} |
56
|
|
|
} |