through the PUT /transactions/{transactionId} method.
The category is also returned on a /transaction(s) call.
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
17 lines
625 B
Go
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
|