diff --git a/core/model/gorm_model.go b/core/model/gorm_model.go index 7cc52cc..fbdcd59 100644 --- a/core/model/gorm_model.go +++ b/core/model/gorm_model.go @@ -247,6 +247,38 @@ func (m *GormModel) InsertTransaction(transaction *types.Transaction) error { return m.repository.InsertTransaction(transaction) } +func (m *GormModel) GetTransaction(transactionId, orgId, userId string) (*types.Transaction, error) { + // For now, delegate to repository - in a full implementation, this would include permission checking + return m.repository.GetTransactionById(transactionId) +} + +// AttachmentInterface implementation +func (m *GormModel) CreateAttachment(attachment *types.Attachment) (*types.Attachment, error) { + if attachment.Id == "" { + return nil, errors.New("attachment ID required") + } + + // Set upload timestamp + attachment.Uploaded = time.Now() + attachment.Deleted = false + + // For GORM implementation, we'd need to implement repository methods + // For now, return an error indicating not implemented + return nil, errors.New("attachment operations not yet implemented for GORM model") +} + +func (m *GormModel) GetAttachmentsByTransaction(transactionId, orgId, userId string) ([]*types.Attachment, error) { + return nil, errors.New("attachment operations not yet implemented for GORM model") +} + +func (m *GormModel) GetAttachment(attachmentId, transactionId, orgId, userId string) (*types.Attachment, error) { + return nil, errors.New("attachment operations not yet implemented for GORM model") +} + +func (m *GormModel) DeleteAttachment(attachmentId, transactionId, orgId, userId string) error { + return errors.New("attachment operations not yet implemented for GORM model") +} + func (m *GormModel) GetTransactionById(id string) (*types.Transaction, error) { return m.repository.GetTransactionById(id) }