Display problematic transactions #53

Merged
jacob1123 merged 16 commits from problematic-transactions into master 2022-04-23 13:32:39 +02:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 0c68438732 - Show all commits

View File

@ -60,4 +60,5 @@ LEFT JOIn accounts AS otherGroupAccount
ON otherGroupTransaction.account_id = accounts.id ON otherGroupTransaction.account_id = accounts.id
WHERE transactions.category_id IS NULL WHERE transactions.category_id IS NULL
AND accounts.on_budget AND accounts.on_budget
AND (otherGroupAccount.id IS NULL OR NOT otherGroupAccount.on_budget); AND (otherGroupAccount.id IS NULL OR NOT otherGroupAccount.on_budget)
AND accounts.budget_id = $1;

View File

@ -132,6 +132,7 @@ LEFT JOIn accounts AS otherGroupAccount
WHERE transactions.category_id IS NULL WHERE transactions.category_id IS NULL
AND accounts.on_budget AND accounts.on_budget
AND (otherGroupAccount.id IS NULL OR NOT otherGroupAccount.on_budget) AND (otherGroupAccount.id IS NULL OR NOT otherGroupAccount.on_budget)
AND accounts.budget_id = $1
` `
type GetProblematicTransactionsRow struct { type GetProblematicTransactionsRow struct {
@ -167,8 +168,8 @@ type GetProblematicTransactionsRow struct {
LastReconciled_2 sql.NullTime LastReconciled_2 sql.NullTime
} }
func (q *Queries) GetProblematicTransactions(ctx context.Context) ([]GetProblematicTransactionsRow, error) { func (q *Queries) GetProblematicTransactions(ctx context.Context, budgetID uuid.UUID) ([]GetProblematicTransactionsRow, error) {
rows, err := q.db.QueryContext(ctx, getProblematicTransactions) rows, err := q.db.QueryContext(ctx, getProblematicTransactions, budgetID)
if err != nil { if err != nil {
return nil, err return nil, err
} }