Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Bortz committed Apr 17, 2023
2 parents 518cdab + 1bc5f97 commit 36fa2ab
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1]
php: [7.3, 7.4, 8.0, 8.1]
laravel: [6.*, 7.*, 8.*, 9.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
Expand All @@ -27,9 +27,9 @@ jobs:
- laravel: 7.*
php: 8.1
- laravel: 8.*
php: 7.2
php: 7.3
- laravel: 9.*
php: 7.2
php: 7.3
- laravel: 9.*
php: 7.3
- laravel: 9.*
Expand All @@ -52,7 +52,7 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion src/Api/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function all(int $limit = 1000)
/**
* Return a single tag.
*
* @param $contryId
* @param $tagId
* @return mixed
*/
public function get($tagId)
Expand Down
44 changes: 44 additions & 0 deletions src/Api/TagRelation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/*
* TagRelation.php
* @author Eric Bortz <e.bortz@netstack.de>
* @copyright 2023 Eric Bortz
*/


namespace NetstackDE\LaravelSevdeskApi\Api;

use NetstackDE\LaravelSevdeskApi\Api\Utils\ApiClient;
use NetstackDE\LaravelSevdeskApi\Api\Utils\Routes;
use Illuminate\Support\Collection;

/**
* Sevdesk Contact Api
*
* @see https://api.sevdesk.de/#tag/Tag/operation/getTagRelations
*/

class TagRelation extends ApiClient
{
/**
* Return all tag relations.
*
* @return mixed
*/
public function all(int $limit = 1000)
{
return Collection::make($this->_get(Routes::TAG_RELATION, ['limit' => $limit]));
}

/**
* Return a single tag relation.
*
* @param $tagRelationId
* @return mixed
*/
public function get($tagRelationId)
{
return $this->_get(Routes::TAG_RELATION. '/' . $tagRelationId)[0];
}

}
3 changes: 2 additions & 1 deletion src/Api/Utils/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ class Routes
const CONTACT = 'Contact';
const CONTACT_ADDRESS = 'ContactAddress';
const COMMUNICATION_WAY = 'CommunicationWay';
const CREATE_INVOICE = 'Invoice/Factory/saveInvoice';
const CREDIT_NOTE = 'CreditNote';
const INVOICE = 'Invoice';
const CREATE_INVOICE = 'Invoice/Factory/saveInvoice';
const STATIC_COUNTRY = 'StaticCountry';
const TAG = 'Tag';
const TAG_RELATION = 'TagRelation';
}

0 comments on commit 36fa2ab

Please sign in to comment.