-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a query page so people can discover their own query url. And add some base things for the graph. * Add a working metrics system, and failed jobs viewer. * Remove code that caused a bug * Address PR feedback * Refactor the tests, and clean up the filiters so they use Arrayable * Refactor the ugly chart controller some by adding a repository method for getting the transactions by dates... * Add transaction repositorycontract * Add metric and value changes. And update the ugly chart controller some more. * Update the graph/metrics * Update ugly controller more, and update the settings with toasted * Fix the bugon the metrics
- Loading branch information
Austin Kregel
authored
Jun 29, 2020
1 parent
625815d
commit 52ac0d3
Showing
75 changed files
with
1,469 additions
and
11,975 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
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
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
app/Contracts/Repositories/TransactionRepositoryContract.php
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,17 @@ | ||
<?php | ||
|
||
namespace App\Contracts\Repositories; | ||
|
||
use App\User; | ||
use Carbon\Carbon; | ||
use Illuminate\Support\Collection; | ||
|
||
/** | ||
* Interface TransactionRepository. | ||
* | ||
* @package namespace App\Contracts\Repositories; | ||
*/ | ||
interface TransactionRepositoryContract extends AbstractRepositoryInterface | ||
{ | ||
public function findAllBetweenDateForUserInScope(User $user, Carbon $startDate, Carbon $endDate, string $scope): Collection; | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,35 @@ | ||
<?php | ||
|
||
namespace App\Filters\Metrics; | ||
|
||
use App\Models\Transaction; | ||
use Illuminate\Support\Collection; | ||
|
||
class TrendFilter | ||
{ | ||
public function handle(array $duration, Collection $data): array | ||
{ | ||
[$durationStart, $durationEnd] = $duration; | ||
|
||
$numericalDuration = $durationStart->diffInDays($durationEnd); | ||
|
||
if ($numericalDuration > 31) { | ||
$numericalDuration = $durationStart->diffInMonths($durationEnd); | ||
} | ||
$returnedData = []; | ||
|
||
for ($i = 0; $i < $numericalDuration; $i++) { | ||
$returnedData[$durationStart->copy()->addDay($i)->format('m/d')] = 0; | ||
} | ||
|
||
$data->each(function (Transaction $transaction) use (&$returnedData) { | ||
if (!array_key_exists($transaction->date->format('m/d'), $returnedData)) { | ||
$returnedData[$transaction->date->format('m/d')] = 0; | ||
} | ||
|
||
$returnedData[$transaction->date->format('m/d')] += $transaction->amount; | ||
}); | ||
|
||
return $returnedData; | ||
} | ||
} |
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,14 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
class CacheController | ||
{ | ||
public function __invoke(Request $request) | ||
{ | ||
cache()->tags([$request->user()->email])->flush(); | ||
return response('', 200); | ||
} | ||
} |
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
Oops, something went wrong.