You've already forked openaccounting-server
forked from cybercinch/openaccounting-server
- 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>
36 lines
657 B
Go
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
|
|
}
|
|
|