Luís Murta 13d752e69a
Support modifying a transaction category
through the PUT /transactions/{transactionId} method.

Restrict the PUT to changing only the category. The other existing
attributes should remain immutable.
Remove the body of the PUT response, it isn't required, and it was
returning a 204, which shouldn't have it.

This patch also extracts the CategoryName as a separate component on the
OpenAPI spec, so that it can be reused on the Transaction.

Issues #26 and #23
2024-06-23 23:03:58 +01:00

17 lines
625 B
Go

package dal
import "git.rosemyrtle.work/personal-finance/server/internal/entity"
type DAL interface {
Transaction(transactionId int64) (*entity.Transaction, error)
Transactions() (entity.Transactions, error)
InsertTransaction(entity.Transaction) (entity.Transaction, error)
UpdateTransaction(entity.TransactionId, *entity.CategoryName) (bool, error)
TransactionExists(uint64) (bool, error)
Bank(bankId string) (*entity.Bank, error)
Banks() (entity.Banks, error)
Categories() (entity.Categories, error)
}
//go:generate go run go.uber.org/mock/mockgen@latest -destination=../mock/mock_dal.gen.go -package=mock . DAL