Skip to content

Commit 20a6043

Browse files
authored
Merge branch 'dev' into feature/265-add-disk
2 parents 4f5b518 + beadffd commit 20a6043

File tree

60 files changed

+5273
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5273
-0
lines changed

CHANGELOG.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,38 @@
4848
- `getVersions` returns a list of file versions
4949
- `restoreFromVersion` restores the file from a specific version
5050
- `getExternalLink` returns a public link to the file
51+
- Added service `Services\Sale\Shipment\Service\Shipment` with support methods,
52+
see [sale.shipment.* methods](https://github.com/bitrix24/b24phpsdk/issues/250):
53+
- `add` adds a shipment
54+
- `update` updates the fields of a shipment
55+
- `get` returns a shipment by its identifier
56+
- `list` returns a list of shipments
57+
- `delete` deletes a shipment
58+
- `getFields` returns the fields and settings for shipments
59+
- Added service `Services\Sale\ShipmentProperty\Service\ShipmentProperty` with support methods,
60+
see [sale.shipmentproperty.* methods](https://github.com/bitrix24/b24phpsdk/issues/250):
61+
- `add` adds a shipment property
62+
- `update` updates the fields of a shipment property
63+
- `get` returns a shipment property by its identifier
64+
- `list` returns a list of shipment properties
65+
- `delete` deletes a shipment property
66+
- `getFieldsByType` returns the fields and settings for shipment properties by type
67+
- Added service `Services\Sale\ShipmentPropertyValue\Service\ShipmentPropertyValue` with support methods,
68+
see [sale.shipmentpropertyvalue.* methods](https://github.com/bitrix24/b24phpsdk/issues/250):
69+
- `modify` updates shipment property values for a shipment
70+
- `get` returns a shipment property value by its identifier
71+
- `list` returns a list of shipment property values
72+
- `delete` deletes a shipment property value
73+
- `getFields` returns the fields and settings for shipment property values
74+
75+
- Added service `Services\Sale\ShipmentItem\Service\ShipmentItem` with support methods,
76+
see [sale.shipmentitem.* methods](https://github.com/bitrix24/b24phpsdk/issues/250):
77+
- `add` adds a new shipment item
78+
- `update` updates the fields of a shipment item
79+
- `get` returns a shipment item by its identifier
80+
- `list` returns a list of shipment items
81+
- `delete` deletes a shipment item
82+
- `getFields` returns the fields and settings for shipment items
5183
- Added service `Services\Sale\Payment\Service\Payment` with support methods,
5284
see [sale.payment.* methods](https://github.com/bitrix24/b24phpsdk/issues/248):
5385
- `add` adds a payment
@@ -56,6 +88,28 @@
5688
- `list` returns a list of payments
5789
- `delete` deletes a payment
5890
- `getFields` returns the fields and settings for payments
91+
- Added service `Services\Sale\PaymentItemBasket\Service\PaymentItemBasket` with support methods,
92+
see [sale.paymentitembasket.* methods](https://github.com/bitrix24/b24phpsdk/issues/253):
93+
- `add` adds a binding of a basket item to a payment
94+
- `update` updates the binding of a basket item to a payment
95+
- `get` returns the values of all fields for the basket item binding to payment
96+
- `list` returns a list of bindings of basket items to payments
97+
- `delete` deletes the binding of a basket item to a payment
98+
- `getFields` returns the available fields for payment item basket bindings
99+
- Added service `Services\Sale\PaymentItemShipment\Service\PaymentItemShipment` with support methods,
100+
see [sale.paymentitemshipment.* methods](https://github.com/bitrix24/b24phpsdk/issues/253):
101+
- `add` adds a binding of a payment to a shipment
102+
- `update` updates the binding of a payment to a shipment
103+
- `get` returns the values of all fields for the payment binding to shipment
104+
- `list` returns a list of bindings of payments to shipments
105+
- `delete` deletes the binding of a payment to a shipment
106+
- `getFields` returns the available fields for payment item shipment bindings
107+
- Added service `Services\Sale\PropertyRelation\Service\PropertyRelation` with support methods,
108+
see [sale.propertyRelation.* methods](https://github.com/bitrix24/b24phpsdk/issues/253):
109+
- `add` adds a property binding
110+
- `list` retrieves a list of property bindings
111+
- `deleteByFilter` removes the property relation
112+
- `getFields` returns the available fields for property binding
59113

60114
## 1.6.0 – 2025.09.01
61115

Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ help:
5151
@echo ""
5252
@echo "test-unit - run unit tests"
5353
@echo "test-integration-sale-basket-property - run BasketProperty integration tests"
54+
@echo "test-integration-sale-payment-item-basket - run PaymentItemBasket integration tests"
55+
@echo "test-integration-sale-payment-item-shipment - run PaymentItemShipment integration tests"
56+
@echo "test-integration-sale-property-relation - run PropertyRelation integration tests"
5457

5558

5659
.PHONY: docker-init
@@ -216,6 +219,22 @@ test-integration-sale-status:
216219
test-integration-sale-status-lang:
217220
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_status_lang
218221

222+
.PHONY: test-integration-scope-sale-shipment
223+
test-integration-scope-sale-shipment:
224+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_shipment
225+
226+
.PHONY: test-integration-scope-sale-shipment-property
227+
test-integration-scope-sale-shipment-property:
228+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_shipment_property
229+
230+
.PHONY: test-integration-scope-sale-shipment-property-value
231+
test-integration-scope-sale-shipment-property-value:
232+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_shipment_property_value
233+
234+
.PHONY: test-integration-scope-sale-shipment-item
235+
test-integration-scope-sale-shipment-item:
236+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_shipment_item
237+
219238
.PHONY: test-integration-sale-basket-property
220239
test-integration-sale-basket-property:
221240
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_basket_property
@@ -227,6 +246,18 @@ test-integration-sale-basket:
227246
.PHONY: test-integration-sale-order
228247
test-integration-sale-order:
229248
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_order
249+
250+
.PHONY: test-integration-sale-payment-item-basket
251+
test-integration-sale-payment-item-basket:
252+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_payment_item_basket
253+
254+
.PHONY: test-integration-sale-payment-item-shipment
255+
test-integration-sale-payment-item-shipment:
256+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_payment_item_shipment
257+
258+
.PHONY: test-integration-sale-property-relation
259+
test-integration-sale-property-relation:
260+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_property_relation
230261

231262
.PHONY: test-integration-scope-crm
232263
test-integration-scope-crm:
@@ -320,6 +351,10 @@ integration_tests_sale:
320351
integration_tests_sale_payment:
321352
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_payment
322353

354+
.PHONY: integration_tests_sale_payment_item_basket
355+
integration_tests_sale_payment_item_basket:
356+
docker-compose run --rm php-cli vendor/bin/phpunit --testsuite integration_tests_sale_payment_item_basket
357+
323358
# work dev environment
324359
.PHONY: php-dev-server-up
325360
php-dev-server-up:

phpunit.xml.dist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,30 @@
145145
<testsuite name="integration_tests_sale_payment">
146146
<directory>./tests/Integration/Services/Sale/Payment/</directory>
147147
</testsuite>
148+
<testsuite name="integration_tests_sale_payment_item_basket">
149+
<directory>./tests/Integration/Services/Sale/PaymentItemBasket/</directory>
150+
</testsuite>
151+
<testsuite name="integration_tests_sale_payment_item_shipment">
152+
<directory>./tests/Integration/Services/Sale/PaymentItemShipment/</directory>
153+
</testsuite>
154+
<testsuite name="integration_tests_sale_property_relation">
155+
<directory>./tests/Integration/Services/Sale/PropertyRelation/</directory>
156+
</testsuite>
148157
<testsuite name="integration_tests_sale_order">
149158
<directory>./tests/Integration/Services/Sale/Order/</directory>
150159
</testsuite>
160+
<testsuite name="integration_tests_sale_shipment">
161+
<directory>./tests/Integration/Services/Sale/Shipment/</directory>
162+
</testsuite>
163+
<testsuite name="integration_tests_sale_shipment_property">
164+
<directory>./tests/Integration/Services/Sale/ShipmentProperty/</directory>
165+
</testsuite>
166+
<testsuite name="integration_tests_sale_shipment_property_value">
167+
<directory>./tests/Integration/Services/Sale/ShipmentPropertyValue/</directory>
168+
</testsuite>
169+
<testsuite name="integration_tests_sale_shipment_item">
170+
<directory>./tests/Integration/Services/Sale/ShipmentItem/</directory>
171+
</testsuite>
151172
</testsuites>
152173
<source>
153174
<include>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the bitrix24-php-sdk package.
5+
*
6+
* © Sally Fancen <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the MIT-LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Bitrix24\SDK\Services\Sale\PaymentItemBasket\Result;
15+
16+
use Bitrix24\SDK\Core\Exceptions\BaseException;
17+
use Bitrix24\SDK\Core\Result\AddedItemResult;
18+
19+
/**
20+
* Class PaymentItemBasketAddedResult
21+
* Represents the result of an add payment item basket binding operation.
22+
*/
23+
class PaymentItemBasketAddedResult extends AddedItemResult
24+
{
25+
/**
26+
* @throws BaseException
27+
*/
28+
public function getId(): int
29+
{
30+
$result = $this->getCoreResponse()->getResponseData()->getResult();
31+
return isset($result['paymentItemBasket']['id']) ? (int)$result['paymentItemBasket']['id'] : 0;
32+
}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the bitrix24-php-sdk package.
5+
*
6+
* © Sally Fancen <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the MIT-LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Bitrix24\SDK\Services\Sale\PaymentItemBasket\Result;
15+
16+
use Bitrix24\SDK\Core\Exceptions\BaseException;
17+
use Bitrix24\SDK\Core\Result\FieldsResult;
18+
19+
/**
20+
* Class PaymentItemBasketFieldsResult
21+
* Represents the result of a payment item basket binding fields operation.
22+
*/
23+
class PaymentItemBasketFieldsResult extends FieldsResult
24+
{
25+
/**
26+
* @throws BaseException
27+
*/
28+
public function getFieldsDescription(): array
29+
{
30+
$result = $this->getCoreResponse()->getResponseData()->getResult();
31+
return $result['paymentItemBasket'] ?? [];
32+
}
33+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the bitrix24-php-sdk package.
5+
*
6+
* © Sally Fancen <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the MIT-LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Bitrix24\SDK\Services\Sale\PaymentItemBasket\Result;
15+
16+
use Bitrix24\SDK\Core\Result\AbstractItem;
17+
use Carbon\CarbonImmutable;
18+
19+
/**
20+
* Class PaymentItemBasketItemResult
21+
* Represents a single payment item basket binding returned by Bitrix24 REST API.
22+
*
23+
* Fields and their types are taken from Bitrix24 API (sale.paymentitembasket.getfields).
24+
*
25+
* @property-read int|null $id Binding identifier
26+
* @property-read int|null $paymentId Payment identifier
27+
* @property-read int|null $basketId Basket item identifier
28+
* @property-read string|null $quantity Quantity of the product
29+
* @property-read string|null $xmlId External record identifier
30+
* @property-read CarbonImmutable|null $dateInsert Date when the binding was created
31+
*/
32+
class PaymentItemBasketItemResult extends AbstractItem
33+
{
34+
public function getId(): ?int
35+
{
36+
return isset($this->data['id']) ? (int)$this->data['id'] : null;
37+
}
38+
39+
public function getPaymentId(): ?int
40+
{
41+
return isset($this->data['paymentId']) ? (int)$this->data['paymentId'] : null;
42+
}
43+
44+
public function getBasketId(): ?int
45+
{
46+
return isset($this->data['basketId']) ? (int)$this->data['basketId'] : null;
47+
}
48+
49+
public function getQuantity(): ?float
50+
{
51+
return isset($this->data['quantity']) ? (float)$this->data['quantity'] : null;
52+
}
53+
54+
public function getXmlId(): ?string
55+
{
56+
return isset($this->data['xmlId']) ? (string)$this->data['xmlId'] : null;
57+
}
58+
59+
public function getDateInsert(): ?CarbonImmutable
60+
{
61+
return isset($this->data['dateInsert']) ? CarbonImmutable::parse($this->data['dateInsert']) : null;
62+
}
63+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the bitrix24-php-sdk package.
5+
*
6+
* © Sally Fancen <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the MIT-LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Bitrix24\SDK\Services\Sale\PaymentItemBasket\Result;
15+
16+
use Bitrix24\SDK\Core\Result\AbstractResult;
17+
18+
/**
19+
* Class PaymentItemBasketResult
20+
* Represents the result of a single payment item basket binding operation.
21+
*/
22+
class PaymentItemBasketResult extends AbstractResult
23+
{
24+
/**
25+
* Returns the payment item basket binding as PaymentItemBasketItemResult
26+
*/
27+
public function paymentItemBasket(): PaymentItemBasketItemResult
28+
{
29+
$result = $this->getCoreResponse()->getResponseData()->getResult();
30+
return new PaymentItemBasketItemResult($result['paymentItemBasket'] ?? []);
31+
}
32+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the bitrix24-php-sdk package.
5+
*
6+
* © Sally Fancen <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the MIT-LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Bitrix24\SDK\Services\Sale\PaymentItemBasket\Result;
15+
16+
use Bitrix24\SDK\Core\Exceptions\BaseException;
17+
use Bitrix24\SDK\Core\Result\UpdatedItemResult;
18+
19+
/**
20+
* Class PaymentItemBasketUpdatedResult
21+
* Represents the result of an update payment item basket binding operation.
22+
*/
23+
class PaymentItemBasketUpdatedResult extends UpdatedItemResult
24+
{
25+
/**
26+
* @throws BaseException
27+
*/
28+
public function isSuccess(): bool
29+
{
30+
$result = $this->getCoreResponse()->getResponseData()->getResult();
31+
return isset($result['paymentItemBasket']) && !empty($result['paymentItemBasket']);
32+
}
33+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the bitrix24-php-sdk package.
5+
*
6+
* © Sally Fancen <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the MIT-LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Bitrix24\SDK\Services\Sale\PaymentItemBasket\Result;
15+
16+
use Bitrix24\SDK\Core\Exceptions\BaseException;
17+
use Bitrix24\SDK\Core\Result\AbstractResult;
18+
19+
/**
20+
* Class PaymentItemBasketsResult
21+
* Represents the result of a list payment item basket bindings operation.
22+
*/
23+
class PaymentItemBasketsResult extends AbstractResult
24+
{
25+
/**
26+
* Returns an array of payment item basket binding items
27+
*
28+
* @return PaymentItemBasketItemResult[] array of payment item basket binding item results
29+
* @throws BaseException
30+
*/
31+
public function getPaymentItemBaskets(): array
32+
{
33+
$result = $this->getCoreResponse()->getResponseData()->getResult();
34+
$paymentItemBaskets = $result['paymentItemsBasket'] ?? [];
35+
return array_map(fn ($item): PaymentItemBasketItemResult => new PaymentItemBasketItemResult($item), $paymentItemBaskets);
36+
}
37+
}

0 commit comments

Comments
 (0)