Skip to content

Commit

Permalink
Merge pull request #270 from IamDejv/DGS-2617-batch-sending-send
Browse files Browse the repository at this point in the history
Add `BatchSendingsEndpoint.send` endpoint
  • Loading branch information
PavelVais authored Oct 16, 2024
2 parents 37fe321 + 14013fc commit 3c3b044
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [Unreleased]
- Add `BatchSendingsEndpoint.send` endpoint

## [2.5.0] - 2024-10-14
- Add `AccountBilling.automaticTagsPlacement`
- Add `AccountBilling.batchSending`
Expand Down
6 changes: 6 additions & 0 deletions src/Endpoint/BatchSendingsEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use DigitalCz\DigiSign\Endpoint\Traits\DeleteEndpointTrait;
use DigitalCz\DigiSign\Endpoint\Traits\GetEndpointTrait;
use DigitalCz\DigiSign\Endpoint\Traits\UpdateEndpointTrait;
use DigitalCz\DigiSign\Resource\BaseResource;
use DigitalCz\DigiSign\Resource\BatchSending;

/**
Expand All @@ -34,4 +35,9 @@ public function items(BatchSending|string $id): BatchSendingItemsEndpoint
{
return new BatchSendingItemsEndpoint($this, $id);
}

public function send(BatchSending|string $id): BaseResource
{
return $this->makeResource($this->postRequest('/{id}/send', ['id' => $id]));
}
}
6 changes: 6 additions & 0 deletions tests/Endpoint/BatchSendingEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public function testCRUD(): void
self::assertLastRequest('DELETE', "/api/batch-sendings/foo");
}

public function testSend(): void
{
self::endpoint()->send('foo');
self::assertLastRequest('POST', "/api/batch-sendings/foo/send");
}

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

0 comments on commit 3c3b044

Please sign in to comment.