-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
105 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
* @author Thomas <[email protected]> | ||
* @version 1.0 | ||
* @access public | ||
* @see https://api.sellsy.com/doc/v2/#tag/Companies | ||
*/ | ||
class CompaniesApi extends AbstractApi | ||
{ | ||
|
@@ -26,7 +27,6 @@ public function __construct() | |
$this->collection = CompanyCollection::class; | ||
} | ||
|
||
|
||
/** | ||
* List all companies. | ||
* | ||
|
@@ -47,7 +47,6 @@ public function index(array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Show a single company by id. | ||
* | ||
|
@@ -69,7 +68,6 @@ public function show(string $id, array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Store (create) an company. | ||
* | ||
|
@@ -95,7 +93,6 @@ public function store(Company $company, array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Update an existing company. | ||
* | ||
|
@@ -121,7 +118,6 @@ public function update(Company $company, array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Delete an existing company. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
* @author Thomas <[email protected]> | ||
* @version 1.0 | ||
* @access public | ||
* @see https://api.sellsy.com/doc/v2/#tag/Contacts | ||
*/ | ||
class ContactsApi extends AbstractApi | ||
{ | ||
|
@@ -26,7 +27,6 @@ public function __construct() | |
$this->collection = ContactCollection::class; | ||
} | ||
|
||
|
||
/** | ||
* List all contacts. | ||
* | ||
|
@@ -47,7 +47,6 @@ public function index(array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Show a single contact by id. | ||
* | ||
|
@@ -69,7 +68,6 @@ public function show(string $id, array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Store (create) an contact. | ||
* | ||
|
@@ -95,7 +93,6 @@ public function store(Contact $contact, array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Update an existing contact. | ||
* | ||
|
@@ -121,7 +118,6 @@ public function update(Contact $contact, array $query = []): self | |
return $this; | ||
} | ||
|
||
|
||
/** | ||
* Delete an existing contact. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,13 @@ | |
use Bluerock\Sellsy\Collections\TaxCollection; | ||
|
||
/** | ||
* The API client for the `companies` namespace. | ||
* The API client for the `taxes` namespace. | ||
* | ||
* @package sellsy-connector | ||
* @author Thomas <[email protected]> | ||
* @version 1.0 | ||
* @access public | ||
* @see https://api.sellsy.com/doc/v2/#tag/Taxes | ||
*/ | ||
class TaxesApi extends AbstractApi | ||
{ | ||
|
@@ -26,7 +27,6 @@ public function __construct() | |
$this->collection = TaxCollection::class; | ||
} | ||
|
||
|
||
/** | ||
* List all taxes. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Bluerock\Sellsy\Api; | ||
|
||
use Bluerock\Sellsy\Entities\Unit; | ||
use Bluerock\Sellsy\Collections\UnitCollection; | ||
|
||
/** | ||
* The API client for the `units` namespace. | ||
* | ||
* @package sellsy-connector | ||
* @author Thomas <[email protected]> | ||
* @version 1.1 | ||
* @access public | ||
* @see https://api.sellsy.com/doc/v2/#tag/Units | ||
*/ | ||
class UnitsApi extends AbstractApi | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->entity = Unit::class; | ||
$this->collection = UnitCollection::class; | ||
} | ||
|
||
/** | ||
* List all units. | ||
* | ||
* @param array $query Query parameters. | ||
* | ||
* @return \Illuminate\Http\Client\Response | ||
* @see https://api.sellsy.com/doc/v2/#operation/get-units | ||
*/ | ||
public function index(array $query = []): self | ||
{ | ||
$response = $this->connection | ||
->request('units') | ||
->get($query); | ||
|
||
$this->response = $response; | ||
$this->response->throw(); | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Bluerock\Sellsy\Collections; | ||
|
||
use Bluerock\Sellsy\Entities\Unit; | ||
use Bluerock\Sellsy\Contracts\EntityCollectionContract; | ||
use Spatie\DataTransferObject\DataTransferObjectCollection; | ||
|
||
/** | ||
* The Unit Entity collection. | ||
* | ||
* @package sellsy-connector | ||
* @author Thomas <[email protected]> | ||
* @version 1.0 | ||
* @access public | ||
* | ||
* @method \Bluerock\Sellsy\Entities\Unit current | ||
*/ | ||
class UnitCollection extends DataTransferObjectCollection implements EntityCollectionContract | ||
{ | ||
public static function create(array $data): UnitCollection | ||
{ | ||
return new static(Unit::arrayOf($data)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Bluerock\Sellsy\Entities; | ||
|
||
use Bluerock\Sellsy\Contracts\EntityContract; | ||
use Spatie\DataTransferObject\FlexibleDataTransferObject; | ||
|
||
/** | ||
* The Tax Entity. | ||
* | ||
* @package sellsy-connector | ||
* @author Thomas <[email protected]> | ||
* @version 1.0 | ||
* @access public | ||
*/ | ||
class Unit extends FlexibleDataTransferObject implements EntityContract | ||
{ | ||
/** | ||
* <READONLY> Tax class ID from Sellsy. | ||
*/ | ||
public int $id; | ||
|
||
/** | ||
* Tax class label. | ||
*/ | ||
public ?string $label; | ||
} |