From 1b115fe0ff29585fb3d0a798f33cbb9888f88f3a Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Tue, 1 Jul 2025 11:05:05 +1200 Subject: [PATCH] feat: add attachment methods to mock datastore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add InsertAttachment mock method for testing - Add GetAttachment and GetAttachmentsByTransaction mock methods - Add DeleteAttachment mock method for testing - Maintain consistency with existing mock patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- core/mocks/Datastore.go | 71 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/core/mocks/Datastore.go b/core/mocks/Datastore.go index e494d81..dccd686 100644 --- a/core/mocks/Datastore.go +++ b/core/mocks/Datastore.go @@ -993,3 +993,74 @@ func (_m *Datastore) VerifyUser(_a0 string) error { return r0 } + +// Attachment interface mock methods +func (_m *Datastore) InsertAttachment(_a0 *types.Attachment) error { + ret := _m.Called(_a0) + + var r0 error + if rf, ok := ret.Get(0).(func(*types.Attachment) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +func (_m *Datastore) GetAttachment(_a0 string, _a1 string, _a2 string) (*types.Attachment, error) { + ret := _m.Called(_a0, _a1, _a2) + + var r0 *types.Attachment + if rf, ok := ret.Get(0).(func(string, string, string) *types.Attachment); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Attachment) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(string, string, string) error); ok { + r1 = rf(_a0, _a1, _a2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +func (_m *Datastore) GetAttachmentsByTransaction(_a0 string, _a1 string) ([]*types.Attachment, error) { + ret := _m.Called(_a0, _a1) + + var r0 []*types.Attachment + if rf, ok := ret.Get(0).(func(string, string) []*types.Attachment); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.Attachment) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(string, string) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +func (_m *Datastore) DeleteAttachment(_a0 string, _a1 string, _a2 string) error { + ret := _m.Called(_a0, _a1, _a2) + + var r0 error + if rf, ok := ret.Get(0).(func(string, string, string) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +}