Skip to content

Commit

Permalink
- Add BatchSendingsEndpoint.MutiSignRecipients endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasDostalDS committed Jan 24, 2025
1 parent 25a34bd commit 967ff77
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes will be documented in this file.
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [Unreleased]
- Add `BatchSendingsEndpoint.MutiSignRecipients` endpoint
- Add `MyEndpoint.updatePreferences` endpoint and `MyPreferences` resource
- Add `SignatureScenarioVersionInfo.role`
- Add `BatchSendingsEndpoint.send` endpoint
Expand Down
13 changes: 13 additions & 0 deletions src/Endpoint/BatchSendingsEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
use DigitalCz\DigiSign\Resource\BaseResource;
use DigitalCz\DigiSign\Resource\BatchSending;
use DigitalCz\DigiSign\Resource\BatchSendingStats;
use DigitalCz\DigiSign\Resource\Collection;
use DigitalCz\DigiSign\Resource\ListResource;
use DigitalCz\DigiSign\Resource\MultiSignRecipientInfo;

/**
* @extends ResourceEndpoint<BatchSending>
Expand Down Expand Up @@ -51,4 +53,15 @@ public function stats(BatchSending|string $id): BatchSendingStats
{
return $this->createResource($this->getRequest('/{id}/stats', ['id' => $id]), BatchSendingStats::class);
}

/**
* @return Collection<MultiSignRecipientInfo>
*/
public function multiSignRecipients(BatchSending|string $id): Collection
{
return $this->createCollectionResource(
$this->getRequest('/{id}/multi-sign-recipients', ['id' => $id]),
MultiSignRecipientInfo::class,
);
}
}
18 changes: 18 additions & 0 deletions src/Resource/MultiSignRecipientInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace DigitalCz\DigiSign\Resource;

class MultiSignRecipientInfo extends BaseResource
{
public string $recipientName;

public string $recipientAlias;

public string $recipientEmail;

public int $count;

public bool $isMultiSignable;
}
6 changes: 6 additions & 0 deletions tests/Endpoint/BatchSendingEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public function testStats(): void
self::assertLastRequest('GET', "/api/batch-sendings/foo/stats");
}

public function testMultiSignRecipients(): void
{
self::endpoint()->multiSignRecipients('foo');
self::assertLastRequest('GET', "/api/batch-sendings/foo/multi-sign-recipients");
}

protected static function endpoint(): BatchSendingsEndpoint
{
return self::dgs()->batchSendings();
Expand Down

0 comments on commit 967ff77

Please sign in to comment.