Compare commits

..

1 Commits

Author SHA1 Message Date
55bd87c864
Implements /transactions PUT method
Adds PUT method to OpenAPI spec.

Given that the transaction IDs are generated on server-side, for the PUT
method to remain idempotent, it can only update existing transactions.

It also adds a TransactionExists method on the DAL.

Issue: #20
2024-06-22 22:30:00 +01:00

View File

@ -355,7 +355,7 @@ func TestDalImpl_UpdateTransaction(t *testing.T) {
mock.
ExpectExec(`
UPDATE pfbudget.transactions
SET date = \$2, description = \$3, value = \$4
SET date = \$2, description = \$3, amount = \$4
WHERE id = \$1`).
WithArgs(tt.args.t.Id, tt.args.t.Date, tt.args.t.Description, tt.args.t.Value).
WillReturnResult(sqlmock.NewResult(0, 1))