2018-10-19 15:31:41 -04:00
|
|
|
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
|
2019-01-17 14:09:13 -02:00
|
|
|
SystemHealthInteface
|
2020-01-14 14:14:16 -05:00
|
|
|
BudgetInterface
|
2018-10-19 15:31:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewModel(db db.Datastore, bcrypt util.Bcrypt, config types.Config) *Model {
|
|
|
|
|
model := &Model{db: db, bcrypt: bcrypt, config: config}
|
|
|
|
|
Instance = model
|
|
|
|
|
return model
|
|
|
|
|
}
|