Expand API and routes.

This commit is contained in:
James Cole
2018-12-08 21:26:20 +01:00
parent 3b15415a1b
commit 05b0425929
27 changed files with 686 additions and 516 deletions

View File

@@ -34,19 +34,6 @@ use Symfony\Component\HttpFoundation\ParameterBag;
*/
class AvailableBudgetTransformer extends TransformerAbstract
{
/**
* List of resources possible to include
*
* @var array
*/
protected $availableIncludes = ['transaction_currency', 'user'];
/**
* List of resources to automatically include
*
* @var array
*/
protected $defaultIncludes = ['transaction_currency'];
/** @var ParameterBag */
protected $parameters;
@@ -62,34 +49,6 @@ class AvailableBudgetTransformer extends TransformerAbstract
$this->parameters = $parameters;
}
/**
* Attach the currency.
*
* @codeCoverageIgnore
*
* @param AvailableBudget $availableBudget
*
* @return Item
*/
public function includeTransactionCurrency(AvailableBudget $availableBudget): Item
{
return $this->item($availableBudget->transactionCurrency, new CurrencyTransformer($this->parameters), 'transaction_currencies');
}
/**
* Attach the user.
*
* @codeCoverageIgnore
*
* @param AvailableBudget $availableBudget
*
* @return Item
*/
public function includeUser(AvailableBudget $availableBudget): Item
{
return $this->item($availableBudget->user, new UserTransformer($this->parameters), 'users');
}
/**
* Transform the note.
*