Files
openaccounting-server/core/model/model.go
Aaron Guise 0d1cb22044 refactor: update data access layer to use GORM repositories
- Replace SQL-based queries with GORM repository calls
- Update all model interfaces to use repository pattern
- Fix compilation errors in core/model/ files
- Update mocks to match new repository interfaces
- Modify API handlers to use new repository layer
- Maintain backward compatibility with existing interfaces

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-30 22:08:08 +12:00

36 lines
657 B
Go

package model
import (
"github.com/openaccounting/oa-server/core/model/db"
"github.com/openaccounting/oa-server/core/model/types"
"github.com/openaccounting/oa-server/core/util"
)
var Instance Interface
type Model struct {
db db.Datastore
bcrypt util.Bcrypt
config types.Config
}
type Interface interface {
UserInterface
OrgInterface
AccountInterface
TransactionInterface
PriceInterface
SessionInterface
ApiKeyInterface
SystemHealthInteface
BudgetInterface
}
func NewModel(db db.Datastore, bcrypt util.Bcrypt, config types.Config) *Model {
model := &Model{db: db, bcrypt: bcrypt, config: config}
Instance = model
return model
}