Implement reconciliation #26

Merged
jacob1123 merged 13 commits from reconcilation into master 2022-02-27 22:16:02 +01:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit d7058a49b0 - Show all commits

View File

@@ -17,6 +17,11 @@ SET date = $1,
category_id = $5 category_id = $5
WHERE id = $6; WHERE id = $6;
-- name: SetTransactionReconciled :exec
UPDATE transactions
SET status = 'Reconciled'
WHERE id = $1;
-- name: DeleteTransaction :exec -- name: DeleteTransaction :exec
DELETE FROM transactions DELETE FROM transactions
WHERE id = $1; WHERE id = $1;

View File

@@ -289,6 +289,17 @@ func (q *Queries) GetTransactionsForAccount(ctx context.Context, accountID uuid.
return items, nil return items, nil
} }
const setTransactionReconciled = `-- name: SetTransactionReconciled :exec
UPDATE transactions
SET status = 'Reconciled'
WHERE id = $1
`
func (q *Queries) SetTransactionReconciled(ctx context.Context, id uuid.UUID) error {
_, err := q.db.ExecContext(ctx, setTransactionReconciled, id)
return err
}
const updateTransaction = `-- name: UpdateTransaction :exec const updateTransaction = `-- name: UpdateTransaction :exec
UPDATE transactions UPDATE transactions
SET date = $1, SET date = $1,