Skip to content

Commit

Permalink
Note possible improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
michalmytych committed Dec 27, 2023
1 parent a01e903 commit cf1100d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions TODOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Check what is happening after changing user settings currency.
* Styles improvements for mobile.
* Totally reorganize reports.
* Currently, saldo on home page is showing value of first account of user. It should show saldo of user selected 'default' account.
* Check if API calls & websockets are properly authorized.
* Add synchronizing bank accounts saldo.
* Add navigation links on some pages.
Expand Down
6 changes: 3 additions & 3 deletions app/Services/Home/HomePageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public function getHomeData(User $user): Collection
'budgetsWithConsumption' => $this->budgetService->allWithConsumption($user),
'currencyCode' => $this->currencyService->resolveCalculationCurrency($user),
'expendituresTodayTotal' => $this->transactionQuerySet->getExpendituresTodayTotal($user),
'eventNotifications' => $this->notificationService->allEvents($user, 4),
'saldoData' => $this->saldoService->getByUser($user),
'eventNotifications' => $this->notificationService->allEvents($user, 4), // @todo - test
'saldoData' => $this->saldoService->getByUser($user), // @todo - change & test
'expendituresThisWeekTotal' => $this->transactionQuerySet->getExpendituresThisWeekTotal($user),
'incomesTodayTotal' => $this->transactionQuerySet->getIncomesTodayTotal($user),
'incomesThisWeekTotal' => $this->transactionQuerySet->getIncomesThisWeekTotal($user),
'synchronizationsCount' => $this->synchronizationService->countByUser($user),
'endUserAgreementCount' => $this->synchronizationService->getEndUserAgreementsCountByUser($user),
'transactionsData' => [
'agreement' => $this->transactionSyncService->getAgreements($user)->first(),
'agreement' => $this->transactionSyncService->getAgreements($user)->first(), // @todo - test & change - should show 'default' synchronization
'transactions' => $this->transactionQuerySet->getTenLatestTransactionsByUserForHomePage($user),
'last_synchronization' => $this->synchronizationService->getLatestSucceededByUser($user)
]
Expand Down
28 changes: 28 additions & 0 deletions tests/Feature/Services/Transaction/Budget/SaldoServiceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Tests\Feature\Services\Transaction\Budget;

use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\Feature\Traits\CreatesTransactionForUser;
use App\Services\Transaction\PersonalAccount\SaldoService;

class SaldoServiceTest extends TestCase
{
use RefreshDatabase, CreatesTransactionForUser;

/**
* @var SaldoService $sut Service under testing.
*/
private readonly SaldoService $sut;

protected function setUp(): void
{
parent::setUp();
$this->sut = app(SaldoService::class);
}

public function test_returns_valid_account_saldo_for_user(): void
{
}
}

0 comments on commit cf1100d

Please sign in to comment.