forked from mirrors/homebox
refactor: repositories (#28)
* cleanup unnecessary mocks * refactor document storage location * remove unused function * move ownership to document types to repo package * move types and mappers to repo package * refactor sets to own package
This commit is contained in:
parent
2e82398e5c
commit
343290a55a
79 changed files with 3169 additions and 3160 deletions
|
@ -10,7 +10,6 @@ import (
|
|||
|
||||
"github.com/hay-kot/homebox/backend/ent"
|
||||
"github.com/hay-kot/homebox/backend/internal/repo"
|
||||
"github.com/hay-kot/homebox/backend/internal/types"
|
||||
"github.com/hay-kot/homebox/backend/pkgs/faker"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
@ -21,7 +20,7 @@ var (
|
|||
tCtx = Context{}
|
||||
tClient *ent.Client
|
||||
tRepos *repo.AllRepos
|
||||
tUser *ent.User
|
||||
tUser repo.UserOut
|
||||
tGroup *ent.Group
|
||||
tSvc *AllServices
|
||||
)
|
||||
|
@ -37,7 +36,7 @@ func bootstrap() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
tUser, err = tRepos.Users.Create(ctx, types.UserCreate{
|
||||
tUser, err = tRepos.Users.Create(ctx, repo.UserCreate{
|
||||
Name: fk.Str(10),
|
||||
Email: fk.Email(),
|
||||
Password: fk.Str(10),
|
||||
|
@ -63,11 +62,10 @@ func TestMain(m *testing.M) {
|
|||
}
|
||||
|
||||
tClient = client
|
||||
tRepos = repo.EntAllRepos(tClient)
|
||||
tSvc = NewServices(tRepos, "/tmp/homebox")
|
||||
tRepos = repo.EntAllRepos(tClient, os.TempDir()+"/homebox")
|
||||
tSvc = NewServices(tRepos)
|
||||
defer client.Close()
|
||||
|
||||
|
||||
bootstrap()
|
||||
tCtx = Context{
|
||||
Context: context.Background(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue