Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BatchSendingsEndpoint.send endpoint #270

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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