Skip to content

Commit

Permalink
fix client
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Korolev authored and denis-korolev committed May 31, 2024
1 parent 1f0e5f4 commit 26e4a9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DiadocApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ public function getCountragentV2(string $myOrgId, string $counteragentOrgId): Co
* @return CounteragentList| \Google\Protobuf\Internal\Message
* @throws DiadocApiException
*/
public function getCountragents(string $myOrgId, CounteragentStatus $counteragentStatus = null, ?int $afterIndexKey = null): CounteragentList
public function getCountragents(string $myOrgId, int $counteragentStatus = null, ?int $afterIndexKey = null): CounteragentList
{
$response = $this->doRequest(
self::RESOURCE_GET_COUNTERAGENTS,
Expand All @@ -1008,7 +1008,7 @@ public function getCountragents(string $myOrgId, CounteragentStatus $counteragen
return $counteragentList;
}

public function getCountragentsV2($myOrgId, CounteragentStatus $counteragentStatus = null, ?string $afterIndexKey = null, ?string $query = null): CounteragentList
public function getCountragentsV2(string $myOrgId, int $counteragentStatus = null, ?string $afterIndexKey = null, ?string $query = null): CounteragentList
{
$response = $this->doRequest(
self::RESOURCE_GET_COUNTERAGENTS_V2,
Expand Down
11 changes: 11 additions & 0 deletions tests/Unit/CouteragentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,16 @@ public function testGetCounteragents(): void
// $result->getCurrentStatus();
// CounteragentStatus::IsMyCounteragent
// IsMyCounteragent

$contragents = $api->getCountragentsV2(
myOrgId: getenv(ConfigNames::ORG_ID),
query: '7017094419'
);
self::assertNotEmpty($contragents);
$count = $contragents->getTotalCount();

self::assertTrue($count === 1);
$result = $contragents->getCounteragents()[0];
$ddd = $result->getCurrentStatus();
}
}

0 comments on commit 26e4a9c

Please sign in to comment.