Skip to content

Commit 23c09d3

Browse files
authored
Merge pull request #10 from lamoda/new-extensions
+ add new extensions lp/perfum/shoes
2 parents 90a5eb3 + 3c15d64 commit 23c09d3

16 files changed

+495
-42
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/.idea/
12
/vendor/
23
/phpunit.xml
4+
/.phpunit.result.*
35
/.php_cs
46
/.php_cs.cache
57
/composer.lock

src/V2/Dto/CreateOrderForEmissionICRequest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
abstract class CreateOrderForEmissionICRequest
88
{
9+
// Способ выпуска товаров в оборот
10+
public const RELEASE_METHOD_TYPE_PRODUCTION = 'PRODUCTION'; // Производство в РФ
11+
public const RELEASE_METHOD_TYPE_IMPORT = 'IMPORT'; // Ввезен в РФ (Импорт)
12+
public const RELEASE_METHOD_TYPE_REMAINS = 'REMAINS'; // Маркировка остатков
13+
public const RELEASE_METHOD_TYPE_CROSSBORDER = 'CROSSBORDER'; // Ввезен в РФ из стран ЕАЭС
14+
public const RELEASE_METHOD_TYPE_REMARK = 'REMARK'; // Перемаркировка
15+
16+
// Способ изготовления
17+
public const CREATE_METHOD_TYPE_SELF_MADE = 'SELF_MADE'; // Самостоятельно
18+
public const CREATE_METHOD_TYPE_CEM = 'CEM'; // ЦЭМ
19+
public const CREATE_METHOD_TYPE_CM = 'CM'; // Контрактное производство
20+
public const CREATE_METHOD_TYPE_CL = 'CL'; // Логистический склад
21+
public const CREATE_METHOD_TYPE_CA = 'CA'; // Комиссионная площадка
22+
923
/**
1024
* @var OrderProduct[]
1125
*/

src/V2/Dto/CreateOrderForEmissionICRequestLight.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88

99
final class CreateOrderForEmissionICRequestLight extends CreateOrderForEmissionICRequest
1010
{
11-
public const RELEASE_METHOD_TYPE_PRODUCTION = 'PRODUCTION';
12-
public const RELEASE_METHOD_TYPE_IMPORT = 'IMPORT';
13-
public const RELEASE_METHOD_TYPE_REMAINS = 'REMAINS';
14-
public const RELEASE_METHOD_TYPE_REMARK = 'REMARK';
15-
16-
public const CREATE_METHOD_TYPE_SELF_MADE = 'SELF_MADE';
17-
public const CREATE_METHOD_TYPE_CEM = 'CEM';
18-
1911
/**
2012
* @var string
2113
*/
@@ -42,7 +34,6 @@ final class CreateOrderForEmissionICRequestLight extends CreateOrderForEmissionI
4234
private $contractDate;
4335

4436
/**
45-
* CreateOrderForEmissionICRequestLight constructor.
4637
* @param string $contactPerson
4738
* @param string $releaseMethodType
4839
* @param string $createMethodType
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lamoda\OmsClient\V2\Dto;
6+
7+
final class CreateOrderForEmissionICRequestLp extends CreateOrderForEmissionICRequest
8+
{
9+
/**
10+
* @var string Контактное лицо
11+
*/
12+
private $contactPerson;
13+
/**
14+
* @var string Способ выпуска товаров в оборот
15+
*/
16+
private $releaseMethodType;
17+
/**
18+
* @var string Способ изготовления СИ
19+
*/
20+
private $createMethodType;
21+
/**
22+
* @var string Идентификатор производственного заказа
23+
*/
24+
private $productionOrderId;
25+
26+
/**
27+
* @param string $contactPerson
28+
* @param string $releaseMethodType
29+
* @param string $createMethodType
30+
* @param string $productionOrderId
31+
* @param OrderProductLp[] $products
32+
*/
33+
public function __construct(
34+
string $contactPerson,
35+
string $releaseMethodType,
36+
string $createMethodType,
37+
string $productionOrderId,
38+
array $products
39+
) {
40+
parent::__construct($products);
41+
42+
$this->contactPerson = $contactPerson;
43+
$this->releaseMethodType = $releaseMethodType;
44+
$this->createMethodType = $createMethodType;
45+
$this->productionOrderId = $productionOrderId;
46+
}
47+
48+
public function getContactPerson(): string
49+
{
50+
return $this->contactPerson;
51+
}
52+
53+
public function getReleaseMethodType(): string
54+
{
55+
return $this->releaseMethodType;
56+
}
57+
58+
public function getCreateMethodType(): string
59+
{
60+
return $this->createMethodType;
61+
}
62+
63+
public function getProductionOrderId(): string
64+
{
65+
return $this->productionOrderId;
66+
}
67+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lamoda\OmsClient\V2\Dto;
6+
7+
final class CreateOrderForEmissionICRequestPerfum extends CreateOrderForEmissionICRequest
8+
{
9+
/**
10+
* @var string Контактное лицо
11+
*/
12+
private $contactPerson;
13+
/**
14+
* @var string Способ выпуска товаров в оборот
15+
*/
16+
private $releaseMethodType;
17+
/**
18+
* @var string Способ изготовления СИ
19+
*/
20+
private $createMethodType;
21+
/**
22+
* @var string Идентификатор производственного заказа
23+
*/
24+
private $productionOrderId;
25+
26+
/**
27+
* @param string $contactPerson
28+
* @param string $releaseMethodType
29+
* @param string $createMethodType
30+
* @param string $productionOrderId
31+
* @param OrderProductPerfum[] $products
32+
*/
33+
public function __construct(
34+
string $contactPerson,
35+
string $releaseMethodType,
36+
string $createMethodType,
37+
string $productionOrderId,
38+
array $products
39+
) {
40+
parent::__construct($products);
41+
42+
$this->contactPerson = $contactPerson;
43+
$this->releaseMethodType = $releaseMethodType;
44+
$this->createMethodType = $createMethodType;
45+
$this->productionOrderId = $productionOrderId;
46+
}
47+
48+
public function getContactPerson(): string
49+
{
50+
return $this->contactPerson;
51+
}
52+
53+
public function getReleaseMethodType(): string
54+
{
55+
return $this->releaseMethodType;
56+
}
57+
58+
public function getCreateMethodType(): string
59+
{
60+
return $this->createMethodType;
61+
}
62+
63+
public function getProductionOrderId(): string
64+
{
65+
return $this->productionOrderId;
66+
}
67+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lamoda\OmsClient\V2\Dto;
6+
7+
final class CreateOrderForEmissionICRequestShoes extends CreateOrderForEmissionICRequest
8+
{
9+
/**
10+
* @var string Контактное лицо
11+
*/
12+
private $contactPerson;
13+
/**
14+
* @var string Способ выпуска товаров в оборот
15+
*/
16+
private $releaseMethodType;
17+
/**
18+
* @var string Способ изготовления СИ
19+
*/
20+
private $createMethodType;
21+
/**
22+
* @var string Идентификатор производственного заказа
23+
*/
24+
private $productionOrderId;
25+
26+
/**
27+
* @param string $contactPerson
28+
* @param string $releaseMethodType
29+
* @param string $createMethodType
30+
* @param string $productionOrderId
31+
* @param OrderProductShoes[] $products
32+
*/
33+
public function __construct(
34+
string $contactPerson,
35+
string $releaseMethodType,
36+
string $createMethodType,
37+
string $productionOrderId,
38+
array $products
39+
) {
40+
parent::__construct($products);
41+
42+
$this->contactPerson = $contactPerson;
43+
$this->releaseMethodType = $releaseMethodType;
44+
$this->createMethodType = $createMethodType;
45+
$this->productionOrderId = $productionOrderId;
46+
}
47+
48+
public function getContactPerson(): string
49+
{
50+
return $this->contactPerson;
51+
}
52+
53+
public function getReleaseMethodType(): string
54+
{
55+
return $this->releaseMethodType;
56+
}
57+
58+
public function getCreateMethodType(): string
59+
{
60+
return $this->createMethodType;
61+
}
62+
63+
public function getProductionOrderId(): string
64+
{
65+
return $this->productionOrderId;
66+
}
67+
}

src/V2/Dto/OrderProduct.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,38 @@
66

77
abstract class OrderProduct
88
{
9-
public const SERIAL_NUMBER_TYPE_SELF_MADE = 'SELF_MADE';
10-
public const SERIAL_NUMBER_TYPE_OPERATOR = 'OPERATOR';
9+
// Способ формирования индивидуального серийного номера
10+
public const SERIAL_NUMBER_TYPE_SELF_MADE = 'SELF_MADE'; // Самостоятельно
11+
public const SERIAL_NUMBER_TYPE_OPERATOR = 'OPERATOR'; // Оператором ГИС МТ
12+
13+
// Тип кода маркировки
14+
public const MARKING_TYPE_UNIT = 'UNIT'; // Единица товара
15+
public const MARKING_TYPE_BUNDLE = 'BUNDLE'; // Комплект
16+
public const MARKING_TYPE_GROUP = 'GROUP'; // Групповая потребительская упаковка
17+
public const MARKING_TYPE_SET = 'SET'; // Набор
18+
19+
// Шаблоны кодов маркировки (пока мы используем только первый)
20+
public const MARKING_TEMPLATE_FIRST = 1; // 01 + GTIN + 21 + serial (13 chars)
21+
public const MARKING_TEMPLATE_SECOND = 2; // 01 + GTIN + 21 + serial (13 chars)
1122

1223
/**
13-
* @var string
24+
* @var string КТ (GTIN) продукта
1425
*/
1526
private $gtin;
1627
/**
17-
* @var int
28+
* @var int Количество КМ
1829
*/
1930
private $quantity;
2031
/**
21-
* @var string
32+
* @var string Способ генерации серийных номеров.
2233
*/
2334
private $serialNumberType;
2435
/**
25-
* @var string[] | null
36+
* @var string[] | null Массив серийных номеров (Это поле указывается, если serialNumber = SELF_MADE)
2637
*/
2738
private $serialNumbers;
2839
/**
29-
* @var integer
40+
* @var integer Идентификатор шаблона КМ
3041
*/
3142
private $templateId;
3243

src/V2/Dto/OrderProductLp.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lamoda\OmsClient\V2\Dto;
6+
7+
final class OrderProductLp extends OrderProduct
8+
{
9+
/**
10+
* @var string Тип кода маркировки
11+
*/
12+
private $cisType;
13+
14+
/**
15+
* @var string ИНН/УНБ (или аналог) экспортера (становится обязательным, если поле releaseMethod = «CROSSBORDER»)
16+
*/
17+
private $exporterTaxpayerId;
18+
19+
20+
public function __construct(string $gtin, int $quantity, string $serialNumberType, int $templateId, string $cisType)
21+
{
22+
parent::__construct($gtin, $quantity, $serialNumberType, $templateId);
23+
24+
$this->cisType = $cisType;
25+
}
26+
27+
public function getCisType(): string
28+
{
29+
return $this->cisType;
30+
}
31+
32+
public function getExporterTaxpayerId(): ?string
33+
{
34+
return $this->exporterTaxpayerId;
35+
}
36+
37+
public function setExporterTaxpayerId(?string $exporterTaxpayerId): void
38+
{
39+
$this->exporterTaxpayerId = $exporterTaxpayerId;
40+
}
41+
}

src/V2/Dto/OrderProductPerfum.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lamoda\OmsClient\V2\Dto;
6+
7+
final class OrderProductPerfum extends OrderProduct
8+
{
9+
/**
10+
* @var string Тип кода маркировки
11+
*/
12+
private $cisType;
13+
14+
/**
15+
* @var string ИНН/УНБ (или аналог) экспортера (становится обязательным, если поле releaseMethod = «CROSSBORDER»)
16+
*/
17+
private $exporterTaxpayerId;
18+
19+
20+
public function __construct(string $gtin, int $quantity, string $serialNumberType, int $templateId, string $cisType)
21+
{
22+
parent::__construct($gtin, $quantity, $serialNumberType, $templateId);
23+
24+
$this->cisType = $cisType;
25+
}
26+
27+
public function getCisType(): string
28+
{
29+
return $this->cisType;
30+
}
31+
32+
public function getExporterTaxpayerId(): ?string
33+
{
34+
return $this->exporterTaxpayerId;
35+
}
36+
37+
public function setExporterTaxpayerId(?string $exporterTaxpayerId): void
38+
{
39+
$this->exporterTaxpayerId = $exporterTaxpayerId;
40+
}
41+
}

0 commit comments

Comments
 (0)