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
146 lines
4.6 KiB
Go
146 lines
4.6 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: git.rosemyrtle.work/personal-finance/server/internal/dal (interfaces: DAL)
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -destination=../mock/mock_dal.gen.go -package=mock . DAL
|
|
//
|
|
|
|
// Package mock is a generated GoMock package.
|
|
package mock
|
|
|
|
import (
|
|
reflect "reflect"
|
|
|
|
entity "git.rosemyrtle.work/personal-finance/server/internal/entity"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockDAL is a mock of DAL interface.
|
|
type MockDAL struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockDALMockRecorder
|
|
}
|
|
|
|
// MockDALMockRecorder is the mock recorder for MockDAL.
|
|
type MockDALMockRecorder struct {
|
|
mock *MockDAL
|
|
}
|
|
|
|
// NewMockDAL creates a new mock instance.
|
|
func NewMockDAL(ctrl *gomock.Controller) *MockDAL {
|
|
mock := &MockDAL{ctrl: ctrl}
|
|
mock.recorder = &MockDALMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockDAL) EXPECT() *MockDALMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Bank mocks base method.
|
|
func (m *MockDAL) Bank(arg0 string) (*entity.Bank, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Bank", arg0)
|
|
ret0, _ := ret[0].(*entity.Bank)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Bank indicates an expected call of Bank.
|
|
func (mr *MockDALMockRecorder) Bank(arg0 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Bank", reflect.TypeOf((*MockDAL)(nil).Bank), arg0)
|
|
}
|
|
|
|
// Banks mocks base method.
|
|
func (m *MockDAL) Banks() ([]entity.Bank, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Banks")
|
|
ret0, _ := ret[0].([]entity.Bank)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Banks indicates an expected call of Banks.
|
|
func (mr *MockDALMockRecorder) Banks() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Banks", reflect.TypeOf((*MockDAL)(nil).Banks))
|
|
}
|
|
|
|
// InsertTransaction mocks base method.
|
|
func (m *MockDAL) InsertTransaction(arg0 entity.Transaction) (entity.Transaction, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "InsertTransaction", arg0)
|
|
ret0, _ := ret[0].(entity.Transaction)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// InsertTransaction indicates an expected call of InsertTransaction.
|
|
func (mr *MockDALMockRecorder) InsertTransaction(arg0 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertTransaction", reflect.TypeOf((*MockDAL)(nil).InsertTransaction), arg0)
|
|
}
|
|
|
|
// Transaction mocks base method.
|
|
func (m *MockDAL) Transaction(arg0 int64) (*entity.Transaction, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Transaction", arg0)
|
|
ret0, _ := ret[0].(*entity.Transaction)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Transaction indicates an expected call of Transaction.
|
|
func (mr *MockDALMockRecorder) Transaction(arg0 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transaction", reflect.TypeOf((*MockDAL)(nil).Transaction), arg0)
|
|
}
|
|
|
|
// TransactionExists mocks base method.
|
|
func (m *MockDAL) TransactionExists(arg0 uint64) (bool, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "TransactionExists", arg0)
|
|
ret0, _ := ret[0].(bool)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// TransactionExists indicates an expected call of TransactionExists.
|
|
func (mr *MockDALMockRecorder) TransactionExists(arg0 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionExists", reflect.TypeOf((*MockDAL)(nil).TransactionExists), arg0)
|
|
}
|
|
|
|
// Transactions mocks base method.
|
|
func (m *MockDAL) Transactions() ([]entity.Transaction, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Transactions")
|
|
ret0, _ := ret[0].([]entity.Transaction)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Transactions indicates an expected call of Transactions.
|
|
func (mr *MockDALMockRecorder) Transactions() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transactions", reflect.TypeOf((*MockDAL)(nil).Transactions))
|
|
}
|
|
|
|
// UpdateTransaction mocks base method.
|
|
func (m *MockDAL) UpdateTransaction(arg0 entity.Transaction) (entity.Transaction, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "UpdateTransaction", arg0)
|
|
ret0, _ := ret[0].(entity.Transaction)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// UpdateTransaction indicates an expected call of UpdateTransaction.
|
|
func (mr *MockDALMockRecorder) UpdateTransaction(arg0 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTransaction", reflect.TypeOf((*MockDAL)(nil).UpdateTransaction), arg0)
|
|
}
|