mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some API route cleanup.
This commit is contained in:
parent
4f76ea560d
commit
fcf578784f
@ -35,19 +35,39 @@ use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* Class DateController
|
||||
* TODO per object group?
|
||||
* TODO transfers voor piggies?
|
||||
* TODO currency?
|
||||
* TODO net worth?
|
||||
*
|
||||
* Class AccountController
|
||||
*
|
||||
* Shows expense information grouped or limited by date.
|
||||
* Ie. all expenses grouped by account + currency.
|
||||
*
|
||||
* /api/v1/insight/expenses/expense
|
||||
* Expenses grouped by expense account. Can be limited by date and by asset account.
|
||||
* /api/v1/insight/expenses/asset
|
||||
* Expenses grouped by asset account. Can be limited by date and by asset account.
|
||||
* /api/v1/insight/expenses/total
|
||||
* Expenses, total (no filter). Can be limited by date and by asset account.
|
||||
* /api/v1/insight/expenses/budget
|
||||
* Expenses per budget or no budget. Can be limited by date and by asset account.
|
||||
* /api/v1/insight/expenses/budget
|
||||
* Also per budget limit.
|
||||
* /api/v1/insight/expenses/category
|
||||
* Expenses per category or no category. Can be limited by date and by asset account.
|
||||
* /api/v1/insight/expenses/bill
|
||||
* Expenses per bill or no bill. Can be limited by date and by asset account.
|
||||
*
|
||||
*/
|
||||
class DateController extends Controller
|
||||
class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
|
||||
private CurrencyRepositoryInterface $currencyRepository;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
|
||||
/**
|
||||
* AccountController constructor.
|
||||
*
|
||||
@ -72,11 +92,12 @@ class DateController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DateRequest $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function basic(DateRequest $request): JsonResponse
|
||||
public function expense(DateRequest $request): JsonResponse
|
||||
{
|
||||
// parameters for chart:
|
||||
$dates = $request->getAll();
|
||||
/** @var Carbon $start */
|
||||
$start = $dates['start'];
|
||||
@ -87,7 +108,6 @@ class DateController extends Controller
|
||||
|
||||
// prep some vars:
|
||||
$currencies = [];
|
||||
$chartData = [];
|
||||
$tempData = [];
|
||||
|
||||
// grab all accounts and names
|
@ -77,9 +77,51 @@ Route::group(
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* DATA CONTROLLERS
|
||||
*
|
||||
*/
|
||||
|
||||
// EXPORT TODO
|
||||
Route::group(
|
||||
['namespace' => 'FireflyIII\Api\V1\Controllers\Data\Export', 'prefix' => 'data/export',
|
||||
'as' => 'api.v1.data.export.',],
|
||||
static function () {
|
||||
Route::get('transactions', ['uses' => 'TransactionController@export', 'as' => 'transactions']);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* INSIGHT CONTROLLERS
|
||||
*/
|
||||
|
||||
// Insight in expenses:
|
||||
Route::group(
|
||||
['namespace' => 'FireflyIII\Api\V1\Controllers\Insight\Expense', 'prefix' => 'insight/expense',
|
||||
'as' => 'api.v1.insight.expense.',],
|
||||
static function () {
|
||||
// Insight in expenses.
|
||||
|
||||
// grouped by expense account or asset account:
|
||||
Route::get('expense', ['uses' => 'AccountController@expense', 'as' => 'expense']);
|
||||
Route::get('asset', ['uses' => 'AccountController@asset', 'as' => 'asset']);
|
||||
|
||||
// TODO total:
|
||||
Route::get('total', ['uses' => 'PeriodController@total', 'as' => 'total']);
|
||||
|
||||
// TODO Budget/no budget and budget limit
|
||||
Route::get('budget', ['uses' => 'BudgetController@budget', 'as' => 'budget']);
|
||||
Route::get('no-budget', ['uses' => 'BudgetController@budget', 'as' => 'budget']);
|
||||
|
||||
// TODO category and no category
|
||||
|
||||
// TODO bill and no bill
|
||||
}
|
||||
);
|
||||
|
||||
//// Insight in income.
|
||||
// // Insight in income by date.
|
||||
// Route::get('income/date/basic', ['uses' => 'Income\DateController@basic', 'as' => 'income.date.basic']);
|
||||
|
||||
|
||||
|
||||
@ -456,22 +498,6 @@ Route::group(
|
||||
}
|
||||
);
|
||||
|
||||
// INSIGHT
|
||||
// TODO VERIFY API DOCS
|
||||
Route::group(
|
||||
['namespace' => 'FireflyIII\Api\V1\Controllers\Insight', 'prefix' => 'insight',
|
||||
'as' => 'api.v1.insight.',],
|
||||
static function () {
|
||||
|
||||
// Insight in expenses.
|
||||
// Insight in expenses by date.
|
||||
Route::get('expense/date/basic', ['uses' => 'Expense\DateController@basic', 'as' => 'expense.date.basic']);
|
||||
|
||||
// Insight in income.
|
||||
// Insight in income by date.
|
||||
Route::get('income/date/basic', ['uses' => 'Income\DateController@basic', 'as' => 'income.date.basic']);
|
||||
}
|
||||
);
|
||||
|
||||
// TODO VERIFY API DOCS
|
||||
Route::group(
|
||||
|
Loading…
Reference in New Issue
Block a user