feat-allow-uploads-document #6

Merged
guisea merged 16 commits from feat-allow-uploads-document into master 2025-07-01 23:20:16 +12:00
Showing only changes of commit f64f83e66f - Show all commits

View File

@@ -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)
}