diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b6c0733..c7752c36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ - Fixed errors in `Bitrix24\SDK\Services\Workflows\Common\WorkflowDocumentId`, see [parsing errors](https://github.com/bitrix24/b24phpsdk/issues/54). +- Fixed the problem with mismatch Deals fields in API and SDK, see + [Increasing code coverage with annotations](https://github.com/bitrix24/b24phpsdk/issues/60). - Fixed error in `Bitrix24\SDK\Core\Fields\FieldsFilter::filterSystemFields`, see [filtration errors](https://github.com/bitrix24/b24phpsdk/issues/65). diff --git a/src/Services/CRM/Common/Result/AbstractCrmItem.php b/src/Services/CRM/Common/Result/AbstractCrmItem.php index a2542cbf..e32c1934 100644 --- a/src/Services/CRM/Common/Result/AbstractCrmItem.php +++ b/src/Services/CRM/Common/Result/AbstractCrmItem.php @@ -52,9 +52,12 @@ public function __get($offset) switch ($offset) { case 'ID': case 'ASSIGNED_BY_ID': + case 'CONTACT_IDS': case 'RESPONSIBLE_ID': case 'CREATED_BY_ID': case 'MODIFY_BY_ID': + case 'MOVED_BY_ID': + case 'MOVED_TIME': case 'createdBy': case 'updatedBy': case 'movedBy': diff --git a/src/Services/CRM/Deal/Result/DealItemResult.php b/src/Services/CRM/Deal/Result/DealItemResult.php index 9cd56c1c..c0cf41ce 100644 --- a/src/Services/CRM/Deal/Result/DealItemResult.php +++ b/src/Services/CRM/Deal/Result/DealItemResult.php @@ -54,6 +54,16 @@ * @property-read string|null $UTM_CAMPAIGN * @property-read string|null $UTM_CONTENT * @property-read string|null $UTM_TERM + * @property-read int|null $ASSIGNED_BY_ID + * @property-read array|null $CONTACT_IDS + * @property-read int|null $CREATED_BY_ID + * @property-read CarbonImmutable $DATE_CREATE + * @property-read CarbonImmutable $DATE_MODIFY + * @property-read int|null $LAST_ACTIVITY_BY + * @property-read CarbonImmutable $LAST_ACTIVITY_TIME + * @property-read int|null $MODIFY_BY_ID + * @property-read int|null $MOVED_BY_ID + * @property-read CarbonImmutable $MOVED_TIME */ class DealItemResult extends AbstractCrmItem { diff --git a/tests/Integration/Services/CRM/Deal/Service/DealTest.php b/tests/Integration/Services/CRM/Deal/Service/DealTest.php index 09fe64a8..35c1bbcd 100644 --- a/tests/Integration/Services/CRM/Deal/Service/DealTest.php +++ b/tests/Integration/Services/CRM/Deal/Service/DealTest.php @@ -18,6 +18,9 @@ use Bitrix24\SDK\Services\CRM\Deal\Service\Deal; use Bitrix24\SDK\Tests\Integration\Fabric; use PHPUnit\Framework\TestCase; +use Bitrix24\SDK\Core; +use Bitrix24\SDK\Tests\CustomAssertions\CustomBitrix24Assertions; +use Bitrix24\SDK\Services\CRM\Deal\Result\DealItemResult; /** * Class DealsTest @@ -26,8 +29,15 @@ */ class DealTest extends TestCase { + use CustomBitrix24Assertions; protected Deal $dealService; + public function testAllSystemFieldsAnnotated(): void + { + $propListFromApi = (new Core\Fields\FieldsFilter())->filterSystemFields(array_keys($this->dealService->fields()->getFieldsDescription())); + $this->assertBitrix24AllResultItemFieldsAnnotated($propListFromApi, DealItemResult::class); + } + /** * @throws BaseException * @throws TransportException