Add SQL Query for update status
This commit is contained in:
parent
eb9fc722aa
commit
d7058a49b0
@ -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;
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user