A continuation of HomeBox the inventory and organization system built for the Home User
refactor: remove empty services (#116)
Haydencd82fe0d8955
diff --git a/Taskfile.yml b/Taskfile.ymlindex 48044eeb..51a756ba 100644--- a/Taskfile.yml+++ b/Taskfile.yml@@ -29,12 +29,12 @@ tasks:- python3 ./scripts/process-types.py ./frontend/lib/api/types/data-contracts.tssources:- "./backend/app/api/**/*"- - "./backend/internal/repo/**/*"+ - "./backend/internal/data/**"- "./backend/internal/services/**/*"- "./scripts/process-types.py"generates:- "./frontend/lib/api/types/data-contracts.ts"- - "./backend/ent/schema"+ - "./backend/internal/data/ent/schema"- "./backend/app/api/static/docs/swagger.json"- "./backend/app/api/static/docs/swagger.yaml"@@ -83,19 +83,19 @@ tasks:desc: Run Entgo.io Code Generationcmds:- |- cd backend && go generate ./... \- --template=ent/schema/templates/has_id.tmpl+ cd backend/internal/ && go generate ./... \+ --template=./data/ent/schema/templates/has_id.tmplsources:- - "./backend/ent/schema/**/*"+ - "./backend/internal/data/ent/schema/**/*"generates:- - "./backend/ent/"+ - "./backend/internal/ent/"db:migration:desc: Runs the database diff engine to generate a SQL migration filesdeps:- db:generatecmds:- - cd backend && go run app/migrations/main.go {{ .CLI_ARGS }}+ - cd backend && go run app/tools/migrations/main.go {{ .CLI_ARGS }}ui:watch:desc: Starts the vitest test runner in watch modediff --git a/backend/app/api/app.go b/backend/app/api/app.goindex 7f6b23f8..854c4e54 100644--- a/backend/app/api/app.go+++ b/backend/app/api/app.go@@ -3,10 +3,10 @@ package mainimport ("time"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/internal/config"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/repo"+ "github.com/hay-kot/homebox/backend/internal/sys/config""github.com/hay-kot/homebox/backend/pkgs/mailer""github.com/hay-kot/homebox/backend/pkgs/server")diff --git a/backend/app/api/demo.go b/backend/app/api/demo.goindex a98f03db..538655d7 100644--- a/backend/app/api/demo.go+++ b/backend/app/api/demo.go@@ -5,7 +5,7 @@ import ("encoding/csv""strings"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services""github.com/rs/zerolog/log")diff --git a/backend/app/api/handlers/v1/controller.go b/backend/app/api/handlers/v1/controller.goindex 2c41bc12..4f7a73e6 100644--- a/backend/app/api/handlers/v1/controller.go+++ b/backend/app/api/handlers/v1/controller.go@@ -3,7 +3,8 @@ package v1import ("net/http"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/pkgs/server")@@ -26,6 +27,7 @@ func WithRegistration(allowRegistration bool) func(*V1Controller) {}type V1Controller struct {+ repo *repo.AllRepossvc *services.AllServicesmaxUploadSize int64isDemo bool@@ -57,8 +59,9 @@ func BaseUrlFunc(prefix string) func(s string) string {}}-func NewControllerV1(svc *services.AllServices, options ...func(*V1Controller)) *V1Controller {+func NewControllerV1(svc *services.AllServices, repos *repo.AllRepos, options ...func(*V1Controller)) *V1Controller {ctrl := &V1Controller{+ repo: repos,svc: svc,allowRegistration: true,}diff --git a/backend/app/api/handlers/v1/v1_ctrl_auth.go b/backend/app/api/handlers/v1/v1_ctrl_auth.goindex 28ee0dc4..b005a9d4 100644--- a/backend/app/api/handlers/v1/v1_ctrl_auth.go+++ b/backend/app/api/handlers/v1/v1_ctrl_auth.go@@ -5,7 +5,7 @@ import ("net/http""time"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog/log"diff --git a/backend/app/api/handlers/v1/v1_ctrl_group.go b/backend/app/api/handlers/v1/v1_ctrl_group.goindex a4038778..a3e89927 100644--- a/backend/app/api/handlers/v1/v1_ctrl_group.go+++ b/backend/app/api/handlers/v1/v1_ctrl_group.go@@ -2,11 +2,10 @@ package v1import ("net/http"- "strings""time"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog/log"@@ -54,13 +53,12 @@ func (ctrl *V1Controller) handleGroupGeneral() server.HandlerFunc {switch r.Method {case http.MethodGet:- group, err := ctrl.svc.Group.Get(ctx)+ group, err := ctrl.repo.Groups.GroupByID(ctx, ctx.GID)if err != nil {log.Err(err).Msg("failed to get group")return validate.NewRequestError(err, http.StatusInternalServerError)}- group.Currency = strings.ToUpper(group.Currency) // TODO: Hack to fix the currency enums being lower caseÍreturn server.Respond(w, http.StatusOK, group)case http.MethodPut:@@ -74,7 +72,7 @@ func (ctrl *V1Controller) handleGroupGeneral() server.HandlerFunc {log.Err(err).Msg("failed to update group")return validate.NewRequestError(err, http.StatusInternalServerError)}- group.Currency = strings.ToUpper(group.Currency) // TODO: Hack to fix the currency enums being lower case+return server.Respond(w, http.StatusOK, group)}diff --git a/backend/app/api/handlers/v1/v1_ctrl_items.go b/backend/app/api/handlers/v1/v1_ctrl_items.goindex 84591ca8..b43333ae 100644--- a/backend/app/api/handlers/v1/v1_ctrl_items.go+++ b/backend/app/api/handlers/v1/v1_ctrl_items.go@@ -7,8 +7,8 @@ import ("strconv""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog/log"@@ -61,7 +61,7 @@ func (ctrl *V1Controller) HandleItemsGetAll() server.HandlerFunc {return func(w http.ResponseWriter, r *http.Request) error {ctx := services.NewContext(r.Context())- items, err := ctrl.svc.Items.Query(ctx, extractQuery(r))+ items, err := ctrl.repo.Items.QueryByGroup(ctx, ctx.GID, extractQuery(r))if err != nil {log.Err(err).Msg("failed to get items")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -87,7 +87,7 @@ func (ctrl *V1Controller) HandleItemsCreate() server.HandlerFunc {}user := services.UseUserCtx(r.Context())- item, err := ctrl.svc.Items.Create(r.Context(), user.GroupID, createData)+ item, err := ctrl.repo.Items.Create(r.Context(), user.GroupID, createData)if err != nil {log.Err(err).Msg("failed to create item")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -144,14 +144,14 @@ func (ctrl *V1Controller) handleItemsGeneral() server.HandlerFunc {switch r.Method {case http.MethodGet:- items, err := ctrl.svc.Items.GetOne(r.Context(), ctx.GID, ID)+ items, err := ctrl.repo.Items.GetOneByGroup(r.Context(), ctx.GID, ID)if err != nil {log.Err(err).Msg("failed to get item")return validate.NewRequestError(err, http.StatusInternalServerError)}return server.Respond(w, http.StatusOK, items)case http.MethodDelete:- err = ctrl.svc.Items.Delete(r.Context(), ctx.GID, ID)+ err = ctrl.repo.Items.DeleteByGroup(r.Context(), ctx.GID, ID)if err != nil {log.Err(err).Msg("failed to delete item")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -164,7 +164,7 @@ func (ctrl *V1Controller) handleItemsGeneral() server.HandlerFunc {return validate.NewRequestError(err, http.StatusInternalServerError)}body.ID = ID- result, err := ctrl.svc.Items.Update(r.Context(), ctx.GID, body)+ result, err := ctrl.repo.Items.UpdateByGroup(r.Context(), ctx.GID, body)if err != nil {log.Err(err).Msg("failed to update item")return validate.NewRequestError(err, http.StatusInternalServerError)diff --git a/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go b/backend/app/api/handlers/v1/v1_ctrl_items_attachments.goindex 5d90157f..e776e9ac 100644--- a/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go+++ b/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go@@ -5,9 +5,9 @@ import ("fmt""net/http"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog/log"diff --git a/backend/app/api/handlers/v1/v1_ctrl_labels.go b/backend/app/api/handlers/v1/v1_ctrl_labels.goindex f02a9295..2551b469 100644--- a/backend/app/api/handlers/v1/v1_ctrl_labels.go+++ b/backend/app/api/handlers/v1/v1_ctrl_labels.go@@ -3,9 +3,9 @@ package v1import ("net/http"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog/log"@@ -21,7 +21,7 @@ import (func (ctrl *V1Controller) HandleLabelsGetAll() server.HandlerFunc {return func(w http.ResponseWriter, r *http.Request) error {user := services.UseUserCtx(r.Context())- labels, err := ctrl.svc.Labels.GetAll(r.Context(), user.GroupID)+ labels, err := ctrl.repo.Labels.GetAll(r.Context(), user.GroupID)if err != nil {log.Err(err).Msg("error getting labels")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -47,7 +47,7 @@ func (ctrl *V1Controller) HandleLabelsCreate() server.HandlerFunc {}user := services.UseUserCtx(r.Context())- label, err := ctrl.svc.Labels.Create(r.Context(), user.GroupID, createData)+ label, err := ctrl.repo.Labels.Create(r.Context(), user.GroupID, createData)if err != nil {log.Err(err).Msg("error creating label")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -103,7 +103,7 @@ func (ctrl *V1Controller) handleLabelsGeneral() server.HandlerFunc {switch r.Method {case http.MethodGet:- labels, err := ctrl.svc.Labels.Get(r.Context(), ctx.GID, ID)+ labels, err := ctrl.repo.Labels.GetOneByGroup(r.Context(), ctx.GID, ID)if err != nil {if ent.IsNotFound(err) {log.Err(err).@@ -117,7 +117,7 @@ func (ctrl *V1Controller) handleLabelsGeneral() server.HandlerFunc {return server.Respond(w, http.StatusOK, labels)case http.MethodDelete:- err = ctrl.svc.Labels.Delete(r.Context(), ctx.GID, ID)+ err = ctrl.repo.Labels.DeleteByGroup(ctx, ctx.GID, ID)if err != nil {log.Err(err).Msg("error deleting label")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -127,14 +127,12 @@ func (ctrl *V1Controller) handleLabelsGeneral() server.HandlerFunc {case http.MethodPut:body := repo.LabelUpdate{}if err := server.Decode(r, &body); err != nil {- log.Err(err).Msg("error decoding label update data")return validate.NewRequestError(err, http.StatusInternalServerError)}body.ID = ID- result, err := ctrl.svc.Labels.Update(r.Context(), ctx.GID, body)+ result, err := ctrl.repo.Labels.UpdateByGroup(ctx, ctx.GID, body)if err != nil {- log.Err(err).Msg("error updating label")return validate.NewRequestError(err, http.StatusInternalServerError)}return server.Respond(w, http.StatusOK, result)diff --git a/backend/app/api/handlers/v1/v1_ctrl_locations.go b/backend/app/api/handlers/v1/v1_ctrl_locations.goindex 775cf760..5e857667 100644--- a/backend/app/api/handlers/v1/v1_ctrl_locations.go+++ b/backend/app/api/handlers/v1/v1_ctrl_locations.go@@ -3,9 +3,9 @@ package v1import ("net/http"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog/log"@@ -21,7 +21,7 @@ import (func (ctrl *V1Controller) HandleLocationGetAll() server.HandlerFunc {return func(w http.ResponseWriter, r *http.Request) error {user := services.UseUserCtx(r.Context())- locations, err := ctrl.svc.Location.GetAll(r.Context(), user.GroupID)+ locations, err := ctrl.repo.Locations.GetAll(r.Context(), user.GroupID)if err != nil {log.Err(err).Msg("failed to get locations")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -48,7 +48,7 @@ func (ctrl *V1Controller) HandleLocationCreate() server.HandlerFunc {}user := services.UseUserCtx(r.Context())- location, err := ctrl.svc.Location.Create(r.Context(), user.GroupID, createData)+ location, err := ctrl.repo.Locations.Create(r.Context(), user.GroupID, createData)if err != nil {log.Err(err).Msg("failed to create location")return validate.NewRequestError(err, http.StatusInternalServerError)@@ -105,7 +105,7 @@ func (ctrl *V1Controller) handleLocationGeneral() server.HandlerFunc {switch r.Method {case http.MethodGet:- location, err := ctrl.svc.Location.GetOne(r.Context(), ctx.GID, ID)+ location, err := ctrl.repo.Locations.GetOneByGroup(r.Context(), ctx.GID, ID)if err != nil {l := log.Err(err).Str("ID", ID.String()).@@ -129,14 +129,14 @@ func (ctrl *V1Controller) handleLocationGeneral() server.HandlerFunc {body.ID = ID- result, err := ctrl.svc.Location.Update(r.Context(), ctx.GID, body)+ result, err := ctrl.repo.Locations.UpdateOneByGroup(r.Context(), ctx.GID, ID, body)if err != nil {log.Err(err).Msg("failed to update location")return validate.NewRequestError(err, http.StatusInternalServerError)}return server.Respond(w, http.StatusOK, result)case http.MethodDelete:- err = ctrl.svc.Location.Delete(r.Context(), ctx.GID, ID)+ err = ctrl.repo.Locations.DeleteByGroup(r.Context(), ctx.GID, ID)if err != nil {log.Err(err).Msg("failed to delete location")return validate.NewRequestError(err, http.StatusInternalServerError)diff --git a/backend/app/api/handlers/v1/v1_ctrl_user.go b/backend/app/api/handlers/v1/v1_ctrl_user.goindex b7bf5eed..565a7231 100644--- a/backend/app/api/handlers/v1/v1_ctrl_user.go+++ b/backend/app/api/handlers/v1/v1_ctrl_user.go@@ -4,8 +4,8 @@ import ("net/http""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog/log"diff --git a/backend/app/api/logger.go b/backend/app/api/logger.goindex 86085a5d..ddc574fa 100644--- a/backend/app/api/logger.go+++ b/backend/app/api/logger.go@@ -4,7 +4,7 @@ import ("os""strings"- "github.com/hay-kot/homebox/backend/internal/config"+ "github.com/hay-kot/homebox/backend/internal/sys/config""github.com/rs/zerolog""github.com/rs/zerolog/log")diff --git a/backend/app/api/main.go b/backend/app/api/main.goindex e48ae047..c62d5df0 100644--- a/backend/app/api/main.go+++ b/backend/app/api/main.go@@ -10,11 +10,11 @@ import (atlas "ariga.io/atlas/sql/migrate""entgo.io/ent/dialect/sql/schema""github.com/hay-kot/homebox/backend/app/api/static/docs"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/internal/config"- "github.com/hay-kot/homebox/backend/internal/migrations"- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/migrations"+ "github.com/hay-kot/homebox/backend/internal/data/repo"+ "github.com/hay-kot/homebox/backend/internal/sys/config""github.com/hay-kot/homebox/backend/internal/web/mid""github.com/hay-kot/homebox/backend/pkgs/server"_ "github.com/mattn/go-sqlite3"diff --git a/backend/app/api/middleware.go b/backend/app/api/middleware.goindex 68bfde15..505ba406 100644--- a/backend/app/api/middleware.go+++ b/backend/app/api/middleware.go@@ -5,7 +5,7 @@ import ("net/http""strings"- "github.com/hay-kot/homebox/backend/internal/services"+ "github.com/hay-kot/homebox/backend/internal/core/services""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server")diff --git a/backend/app/api/routes.go b/backend/app/api/routes.goindex 02a7f74f..90748388 100644--- a/backend/app/api/routes.go+++ b/backend/app/api/routes.go@@ -13,7 +13,7 @@ import ("github.com/hay-kot/homebox/backend/app/api/handlers/debughandlers"v1 "github.com/hay-kot/homebox/backend/app/api/handlers/v1"_ "github.com/hay-kot/homebox/backend/app/api/static/docs"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/pkgs/server"httpSwagger "github.com/swaggo/http-swagger" // http-swagger middleware)@@ -49,6 +49,7 @@ func (a *app) mountRoutes(repos *repo.AllRepos) {v1Ctrl := v1.NewControllerV1(a.services,+ a.repos,v1.WithMaxUploadSize(a.conf.Web.MaxUploadSize),v1.WithRegistration(a.conf.AllowRegistration),v1.WithDemoStatus(a.conf.Demo), // Disable Password Change in Demo Modediff --git a/backend/app/migrations/main.go b/backend/app/tools/migrations/main.gosimilarity index 90%rename from backend/app/migrations/main.gorename to backend/app/tools/migrations/main.goindex bcbb0dd8..a2f66249 100644--- a/backend/app/migrations/main.go+++ b/backend/app/tools/migrations/main.go@@ -5,7 +5,7 @@ import ("log""os"- "github.com/hay-kot/homebox/backend/ent/migrate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/migrate"atlas "ariga.io/atlas/sql/migrate"_ "ariga.io/atlas/sql/sqlite"@@ -17,7 +17,7 @@ import (func main() {ctx := context.Background()// Create a local migration directory able to understand Atlas migration file format for replay.- dir, err := atlas.NewLocalDir("internal/migrations/migrations")+ dir, err := atlas.NewLocalDir("internal/data/migrations/migrations")if err != nil {log.Fatalf("failed creating atlas migration directory: %v", err)}diff --git a/backend/go.mod b/backend/go.modindex d9d7116f..3127969c 100644--- a/backend/go.mod+++ b/backend/go.mod@@ -7,6 +7,7 @@ require (entgo.io/ent v0.11.3github.com/ardanlabs/conf/v2 v2.2.0github.com/go-chi/chi/v5 v5.0.7+ github.com/go-playground/validator/v10 v10.11.1github.com/google/uuid v1.3.0github.com/mattn/go-sqlite3 v1.14.16github.com/rs/zerolog v1.28.0@@ -26,10 +27,12 @@ require (github.com/go-openapi/jsonreference v0.20.0 // indirectgithub.com/go-openapi/spec v0.20.7 // indirectgithub.com/go-openapi/swag v0.22.3 // indirect+ github.com/go-playground/locales v0.14.0 // indirect+ github.com/go-playground/universal-translator v0.18.0 // indirectgithub.com/google/go-cmp v0.5.9 // indirectgithub.com/hashicorp/hcl/v2 v2.14.1 // indirectgithub.com/josharian/intern v1.0.0 // indirect- github.com/kr/pretty v0.3.0 // indirect+ github.com/leodido/go-urn v1.2.1 // indirectgithub.com/mailru/easyjson v0.7.7 // indirectgithub.com/mattn/go-colorable v0.1.13 // indirectgithub.com/mattn/go-isatty v0.0.16 // indirectdiff --git a/backend/go.sum b/backend/go.sumindex 3510f5da..a16fd644 100644--- a/backend/go.sum+++ b/backend/go.sum@@ -31,6 +31,14 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9ghgithub.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=+github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=+github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=+github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=+github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=+github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=+github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=+github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ=+github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=@@ -43,6 +51,7 @@ github.com/hashicorp/hcl/v2 v2.14.1/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zgithub.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=+github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=@@ -50,6 +59,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=+github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=+github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=@@ -61,25 +72,32 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkgithub.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=+github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=+github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=+github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=-github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=+github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=+github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY=github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=+github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=@@ -92,16 +110,20 @@ github.com/swaggo/swag v1.8.7 h1:2K9ivTD3teEO+2fXV6zrZKDqk5IuU2aJtBDo8U7omWU=github.com/swaggo/swag v1.8.7/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk=github.com/zclconf/go-cty v1.11.0 h1:726SxLdi2SDnjY+BStqB9J1hNp4+2WlzyXLuimibIe0=github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA=+golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=+golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=golang.org/x/net v0.0.0-20220923203811-8be639271d50 h1:vKyz8L3zkd+xrMeIaBsQ/MNVPVFSffdaU3ZyYlBGFnI=golang.org/x/net v0.0.0-20220923203811-8be639271d50/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=+golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=@@ -117,11 +139,13 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=diff --git a/backend/internal/core/services/all.go b/backend/internal/core/services/all.gonew file mode 100644index 00000000..5147b8a8--- /dev/null+++ b/backend/internal/core/services/all.go@@ -0,0 +1,24 @@+package services++import "github.com/hay-kot/homebox/backend/internal/data/repo"++type AllServices struct {+ User *UserService+ Group *GroupService+ Items *ItemService+}++func New(repos *repo.AllRepos) *AllServices {+ if repos == nil {+ panic("repos cannot be nil")+ }++ return &AllServices{+ User: &UserService{repos},+ Group: &GroupService{repos},+ Items: &ItemService{+ repo: repos,+ at: attachmentTokens{},+ },+ }+}diff --git a/backend/internal/services/contexts.go b/backend/internal/core/services/contexts.gosimilarity index 96%rename from backend/internal/services/contexts.gorename to backend/internal/core/services/contexts.goindex 72ef84f2..d82dcfa7 100644--- a/backend/internal/services/contexts.go+++ b/backend/internal/core/services/contexts.go@@ -4,7 +4,7 @@ import ("context""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo")type contextKeys struct {diff --git a/backend/internal/services/contexts_test.go b/backend/internal/core/services/contexts_test.gosimilarity index 92%rename from backend/internal/services/contexts_test.gorename to backend/internal/core/services/contexts_test.goindex 24622586..8b7dfa44 100644--- a/backend/internal/services/contexts_test.go+++ b/backend/internal/core/services/contexts_test.go@@ -5,7 +5,7 @@ import ("testing""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/stretchr/testify/assert")diff --git a/backend/internal/services/main_test.go b/backend/internal/core/services/main_test.gosimilarity index 92%rename from backend/internal/services/main_test.gorename to backend/internal/core/services/main_test.goindex 37cb5567..e1f72826 100644--- a/backend/internal/services/main_test.go+++ b/backend/internal/core/services/main_test.go@@ -8,8 +8,8 @@ import ("testing""time"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/pkgs/faker"_ "github.com/mattn/go-sqlite3")diff --git a/backend/internal/services/service_group.go b/backend/internal/core/services/service_group.gosimilarity index 77%rename from backend/internal/services/service_group.gorename to backend/internal/core/services/service_group.goindex 4859f85c..2ca3f86f 100644--- a/backend/internal/services/service_group.go+++ b/backend/internal/core/services/service_group.go@@ -2,10 +2,9 @@ package servicesimport ("errors"- "strings""time"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/pkgs/hasher")@@ -13,10 +12,6 @@ type GroupService struct {repos *repo.AllRepos}-func (svc *GroupService) Get(ctx Context) (repo.Group, error) {- return svc.repos.Groups.GroupByID(ctx.Context, ctx.GID)-}-func (svc *GroupService) UpdateGroup(ctx Context, data repo.GroupUpdate) (repo.Group, error) {if data.Name == "" {data.Name = ctx.User.GroupName@@ -26,8 +21,6 @@ func (svc *GroupService) UpdateGroup(ctx Context, data repo.GroupUpdate) (repo.Greturn repo.Group{}, errors.New("currency cannot be empty")}- data.Currency = strings.ToLower(data.Currency)-return svc.repos.Groups.GroupUpdate(ctx.Context, ctx.GID, data)}diff --git a/backend/internal/services/service_items.go b/backend/internal/core/services/service_items.gosimilarity index 80%rename from backend/internal/services/service_items.gorename to backend/internal/core/services/service_items.goindex 7650a978..5c02724e 100644--- a/backend/internal/services/service_items.go+++ b/backend/internal/core/services/service_items.go@@ -5,7 +5,7 @@ import ("errors""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/rs/zerolog/log")@@ -23,30 +23,6 @@ type ItemService struct {at attachmentTokens}-func (svc *ItemService) GetOne(ctx context.Context, gid uuid.UUID, id uuid.UUID) (repo.ItemOut, error) {- return svc.repo.Items.GetOneByGroup(ctx, gid, id)-}--func (svc *ItemService) Query(ctx Context, q repo.ItemQuery) (repo.PaginationResult[repo.ItemSummary], error) {- return svc.repo.Items.QueryByGroup(ctx, ctx.GID, q)-}--func (svc *ItemService) GetAll(ctx context.Context, gid uuid.UUID) ([]repo.ItemSummary, error) {- return svc.repo.Items.GetAll(ctx, gid)-}--func (svc *ItemService) Create(ctx context.Context, gid uuid.UUID, data repo.ItemCreate) (repo.ItemOut, error) {- return svc.repo.Items.Create(ctx, gid, data)-}--func (svc *ItemService) Delete(ctx context.Context, gid uuid.UUID, id uuid.UUID) error {- return svc.repo.Items.DeleteByGroup(ctx, gid, id)-}--func (svc *ItemService) Update(ctx context.Context, gid uuid.UUID, data repo.ItemUpdate) (repo.ItemOut, error) {- return svc.repo.Items.UpdateByGroup(ctx, gid, data)-}-func (svc *ItemService) CsvImport(ctx context.Context, gid uuid.UUID, data [][]string) (int, error) {loaded := []csvRow{}diff --git a/backend/internal/services/service_items_attachments.go b/backend/internal/core/services/service_items_attachments.gosimilarity index 92%rename from backend/internal/services/service_items_attachments.gorename to backend/internal/core/services/service_items_attachments.goindex 0f2afde4..b5df5f88 100644--- a/backend/internal/services/service_items_attachments.go+++ b/backend/internal/core/services/service_items_attachments.go@@ -7,9 +7,9 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/pkgs/hasher""github.com/rs/zerolog/log")@@ -91,7 +91,7 @@ func (svc *ItemService) AttachmentUpdate(ctx Context, itemId uuid.UUID, data *rereturn repo.ItemOut{}, err}- return svc.GetOne(ctx, ctx.GID, itemId)+ return svc.repo.Items.GetOneByGroup(ctx, ctx.GID, itemId)}// AttachmentAdd adds an attachment to an item by creating an entry in the Documents table and linking it to the Attachment@@ -118,7 +118,7 @@ func (svc *ItemService) AttachmentAdd(ctx Context, itemId uuid.UUID, filename streturn repo.ItemOut{}, err}- return svc.GetOne(ctx, ctx.GID, itemId)+ return svc.repo.Items.GetOneByGroup(ctx, ctx.GID, itemId)}func (svc *ItemService) AttachmentDelete(ctx context.Context, gid, itemId, attachmentId uuid.UUID) error {diff --git a/backend/internal/services/service_items_attachments_test.go b/backend/internal/core/services/service_items_attachments_test.gosimilarity index 84%rename from backend/internal/services/service_items_attachments_test.gorename to backend/internal/core/services/service_items_attachments_test.goindex c3ab0322..14e822e7 100644--- a/backend/internal/services/service_items_attachments_test.go+++ b/backend/internal/core/services/service_items_attachments_test.go@@ -7,7 +7,7 @@ import ("strings""testing"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/stretchr/testify/assert")@@ -19,7 +19,7 @@ func TestItemService_AddAttachment(t *testing.T) {filepath: temp,}- loc, err := tSvc.Location.Create(context.Background(), tGroup.ID, repo.LocationCreate{+ loc, err := tRepos.Locations.Create(context.Background(), tGroup.ID, repo.LocationCreate{Description: "test",Name: "test",})@@ -32,7 +32,7 @@ func TestItemService_AddAttachment(t *testing.T) {LocationID: loc.ID,}- itm, err := svc.Create(context.Background(), tGroup.ID, itmC)+ itm, err := svc.repo.Items.Create(context.Background(), tGroup.ID, itmC)assert.NoError(t, err)assert.NotNil(t, itm)t.Cleanup(func() {diff --git a/backend/internal/services/service_items_csv.go b/backend/internal/core/services/service_items_csv.gosimilarity index 97%rename from backend/internal/services/service_items_csv.gorename to backend/internal/core/services/service_items_csv.goindex c5593869..c9748f7b 100644--- a/backend/internal/services/service_items_csv.go+++ b/backend/internal/core/services/service_items_csv.go@@ -6,7 +6,7 @@ import ("strings""time"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo")var ErrInvalidCsv = errors.New("invalid csv")diff --git a/backend/internal/services/service_items_csv_test.go b/backend/internal/core/services/service_items_csv_test.gosimilarity index 100%rename from backend/internal/services/service_items_csv_test.gorename to backend/internal/core/services/service_items_csv_test.godiff --git a/backend/internal/services/service_items_test.go b/backend/internal/core/services/service_items_test.gosimilarity index 83%rename from backend/internal/services/service_items_test.gorename to backend/internal/core/services/service_items_test.goindex 018dbc16..1daa0b7e 100644--- a/backend/internal/services/service_items_test.go+++ b/backend/internal/core/services/service_items_test.go@@ -22,7 +22,7 @@ func TestItemService_CsvImport(t *testing.T) {assert.Equal(t, 0, count)assert.NoError(t, err)- items, err := svc.GetAll(context.Background(), tGroup.ID)+ items, err := svc.repo.Items.GetAll(context.Background(), tGroup.ID)assert.NoError(t, err)t.Cleanup(func() {for _, item := range items {@@ -38,22 +38,14 @@ func TestItemService_CsvImport(t *testing.T) {dataCsv = append(dataCsv, newCsvRow(item))}- locationService := &LocationService{- repos: tRepos,- }-- LabelService := &LabelService{- repos: tRepos,- }-- allLocation, err := locationService.GetAll(context.Background(), tGroup.ID)+ allLocation, err := tRepos.Locations.GetAll(context.Background(), tGroup.ID)assert.NoError(t, err)locNames := []string{}for _, loc := range allLocation {locNames = append(locNames, loc.Name)}- allLabels, err := LabelService.GetAll(context.Background(), tGroup.ID)+ allLabels, err := tRepos.Labels.GetAll(context.Background(), tGroup.ID)assert.NoError(t, err)labelNames := []string{}for _, label := range allLabels {diff --git a/backend/internal/services/service_user.go b/backend/internal/core/services/service_user.gosimilarity index 99%rename from backend/internal/services/service_user.gorename to backend/internal/core/services/service_user.goindex 3060ee7f..e3d8f8a9 100644--- a/backend/internal/services/service_user.go+++ b/backend/internal/core/services/service_user.go@@ -6,7 +6,7 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo""github.com/hay-kot/homebox/backend/pkgs/hasher""github.com/rs/zerolog/log")diff --git a/backend/internal/services/service_user_defaults.go b/backend/internal/core/services/service_user_defaults.gosimilarity index 91%rename from backend/internal/services/service_user_defaults.gorename to backend/internal/core/services/service_user_defaults.goindex 9882d5e7..34344d16 100644--- a/backend/internal/services/service_user_defaults.go+++ b/backend/internal/core/services/service_user_defaults.go@@ -1,7 +1,7 @@package servicesimport (- "github.com/hay-kot/homebox/backend/internal/repo"+ "github.com/hay-kot/homebox/backend/internal/data/repo")func defaultLocations() []repo.LocationCreate {diff --git a/backend/ent/attachment.go b/backend/internal/data/ent/attachment.gosimilarity index 97%rename from backend/ent/attachment.gorename to backend/internal/data/ent/attachment.goindex e65f1e28..e5f738a2 100644--- a/backend/ent/attachment.go+++ b/backend/internal/data/ent/attachment.go@@ -9,9 +9,9 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item")// Attachment is the model entity for the Attachment schema.diff --git a/backend/ent/attachment/attachment.go b/backend/internal/data/ent/attachment/attachment.gosimilarity index 100%rename from backend/ent/attachment/attachment.gorename to backend/internal/data/ent/attachment/attachment.godiff --git a/backend/ent/attachment/where.go b/backend/internal/data/ent/attachment/where.gosimilarity index 99%rename from backend/ent/attachment/where.gorename to backend/internal/data/ent/attachment/where.goindex 28b806e0..e2adb4f7 100644--- a/backend/ent/attachment/where.go+++ b/backend/internal/data/ent/attachment/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/attachment_create.go b/backend/internal/data/ent/attachment_create.gosimilarity index 98%rename from backend/ent/attachment_create.gorename to backend/internal/data/ent/attachment_create.goindex 75d6cecc..8725984d 100644--- a/backend/ent/attachment_create.go+++ b/backend/internal/data/ent/attachment_create.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item")// AttachmentCreate is the builder for creating a Attachment entity.diff --git a/backend/ent/attachment_delete.go b/backend/internal/data/ent/attachment_delete.gosimilarity index 95%rename from backend/ent/attachment_delete.gorename to backend/internal/data/ent/attachment_delete.goindex a1cda49a..eeeca205 100644--- a/backend/ent/attachment_delete.go+++ b/backend/internal/data/ent/attachment_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// AttachmentDelete is the builder for deleting a Attachment entity.diff --git a/backend/ent/attachment_query.go b/backend/internal/data/ent/attachment_query.gosimilarity index 98%rename from backend/ent/attachment_query.gorename to backend/internal/data/ent/attachment_query.goindex 5554bfba..2262c0bc 100644--- a/backend/ent/attachment_query.go+++ b/backend/internal/data/ent/attachment_query.go@@ -11,10 +11,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// AttachmentQuery is the builder for querying Attachment entities.diff --git a/backend/ent/attachment_update.go b/backend/internal/data/ent/attachment_update.gosimilarity index 98%rename from backend/ent/attachment_update.gorename to backend/internal/data/ent/attachment_update.goindex 1801c221..fbaf4859 100644--- a/backend/ent/attachment_update.go+++ b/backend/internal/data/ent/attachment_update.go@@ -12,10 +12,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// AttachmentUpdate is the builder for updating Attachment entities.diff --git a/backend/ent/authtokens.go b/backend/internal/data/ent/authtokens.gosimilarity index 97%rename from backend/ent/authtokens.gorename to backend/internal/data/ent/authtokens.goindex 285412f0..6e8e53dc 100644--- a/backend/ent/authtokens.go+++ b/backend/internal/data/ent/authtokens.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// AuthTokens is the model entity for the AuthTokens schema.diff --git a/backend/ent/authtokens/authtokens.go b/backend/internal/data/ent/authtokens/authtokens.gosimilarity index 100%rename from backend/ent/authtokens/authtokens.gorename to backend/internal/data/ent/authtokens/authtokens.godiff --git a/backend/ent/authtokens/where.go b/backend/internal/data/ent/authtokens/where.gosimilarity index 99%rename from backend/ent/authtokens/where.gorename to backend/internal/data/ent/authtokens/where.goindex d54ebdd9..5ef7df91 100644--- a/backend/ent/authtokens/where.go+++ b/backend/internal/data/ent/authtokens/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/authtokens_create.go b/backend/internal/data/ent/authtokens_create.gosimilarity index 98%rename from backend/ent/authtokens_create.gorename to backend/internal/data/ent/authtokens_create.goindex 491711ab..e05e8493 100644--- a/backend/ent/authtokens_create.go+++ b/backend/internal/data/ent/authtokens_create.go@@ -11,8 +11,8 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// AuthTokensCreate is the builder for creating a AuthTokens entity.diff --git a/backend/ent/authtokens_delete.go b/backend/internal/data/ent/authtokens_delete.gosimilarity index 95%rename from backend/ent/authtokens_delete.gorename to backend/internal/data/ent/authtokens_delete.goindex 7b861223..50413621 100644--- a/backend/ent/authtokens_delete.go+++ b/backend/internal/data/ent/authtokens_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// AuthTokensDelete is the builder for deleting a AuthTokens entity.diff --git a/backend/ent/authtokens_query.go b/backend/internal/data/ent/authtokens_query.gosimilarity index 98%rename from backend/ent/authtokens_query.gorename to backend/internal/data/ent/authtokens_query.goindex 672a368f..77c13e2e 100644--- a/backend/ent/authtokens_query.go+++ b/backend/internal/data/ent/authtokens_query.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// AuthTokensQuery is the builder for querying AuthTokens entities.diff --git a/backend/ent/authtokens_update.go b/backend/internal/data/ent/authtokens_update.gosimilarity index 98%rename from backend/ent/authtokens_update.gorename to backend/internal/data/ent/authtokens_update.goindex 11e06f25..7d7c541b 100644--- a/backend/ent/authtokens_update.go+++ b/backend/internal/data/ent/authtokens_update.go@@ -12,9 +12,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// AuthTokensUpdate is the builder for updating AuthTokens entities.diff --git a/backend/ent/client.go b/backend/internal/data/ent/client.gosimilarity index 98%rename from backend/ent/client.gorename to backend/internal/data/ent/client.goindex a9a8168b..8273e328 100644--- a/backend/ent/client.go+++ b/backend/internal/data/ent/client.go@@ -9,19 +9,19 @@ import ("log""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/migrate"-- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/migrate"++ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user""entgo.io/ent/dialect""entgo.io/ent/dialect/sql"diff --git a/backend/ent/config.go b/backend/internal/data/ent/config.gosimilarity index 100%rename from backend/ent/config.gorename to backend/internal/data/ent/config.godiff --git a/backend/ent/context.go b/backend/internal/data/ent/context.gosimilarity index 100%rename from backend/ent/context.gorename to backend/internal/data/ent/context.godiff --git a/backend/ent/document.go b/backend/internal/data/ent/document.gosimilarity index 98%rename from backend/ent/document.gorename to backend/internal/data/ent/document.goindex bfc552eb..0c84d7d1 100644--- a/backend/ent/document.go+++ b/backend/internal/data/ent/document.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group")// Document is the model entity for the Document schema.diff --git a/backend/ent/document/document.go b/backend/internal/data/ent/document/document.gosimilarity index 100%rename from backend/ent/document/document.gorename to backend/internal/data/ent/document/document.godiff --git a/backend/ent/document/where.go b/backend/internal/data/ent/document/where.gosimilarity index 99%rename from backend/ent/document/where.gorename to backend/internal/data/ent/document/where.goindex 0cb71398..dc02fa41 100644--- a/backend/ent/document/where.go+++ b/backend/internal/data/ent/document/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/document_create.go b/backend/internal/data/ent/document_create.gosimilarity index 97%rename from backend/ent/document_create.gorename to backend/internal/data/ent/document_create.goindex 4411e16c..b6577dfe 100644--- a/backend/ent/document_create.go+++ b/backend/internal/data/ent/document_create.go@@ -11,10 +11,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group")// DocumentCreate is the builder for creating a Document entity.diff --git a/backend/ent/document_delete.go b/backend/internal/data/ent/document_delete.gosimilarity index 95%rename from backend/ent/document_delete.gorename to backend/internal/data/ent/document_delete.goindex 06ccaf1f..6e21befa 100644--- a/backend/ent/document_delete.go+++ b/backend/internal/data/ent/document_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// DocumentDelete is the builder for deleting a Document entity.diff --git a/backend/ent/document_query.go b/backend/internal/data/ent/document_query.gosimilarity index 98%rename from backend/ent/document_query.gorename to backend/internal/data/ent/document_query.goindex fe439afb..75051524 100644--- a/backend/ent/document_query.go+++ b/backend/internal/data/ent/document_query.go@@ -12,11 +12,11 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// DocumentQuery is the builder for querying Document entities.diff --git a/backend/ent/document_update.go b/backend/internal/data/ent/document_update.gosimilarity index 98%rename from backend/ent/document_update.gorename to backend/internal/data/ent/document_update.goindex fb1b9710..c6dd9fe2 100644--- a/backend/ent/document_update.go+++ b/backend/internal/data/ent/document_update.go@@ -12,11 +12,11 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// DocumentUpdate is the builder for updating Document entities.diff --git a/backend/ent/documenttoken.go b/backend/internal/data/ent/documenttoken.gosimilarity index 97%rename from backend/ent/documenttoken.gorename to backend/internal/data/ent/documenttoken.goindex f42a40f8..c484a9ea 100644--- a/backend/ent/documenttoken.go+++ b/backend/internal/data/ent/documenttoken.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken")// DocumentToken is the model entity for the DocumentToken schema.diff --git a/backend/ent/documenttoken/documenttoken.go b/backend/internal/data/ent/documenttoken/documenttoken.gosimilarity index 100%rename from backend/ent/documenttoken/documenttoken.gorename to backend/internal/data/ent/documenttoken/documenttoken.godiff --git a/backend/ent/documenttoken/where.go b/backend/internal/data/ent/documenttoken/where.gosimilarity index 99%rename from backend/ent/documenttoken/where.gorename to backend/internal/data/ent/documenttoken/where.goindex 1d0949a0..32dbb39e 100644--- a/backend/ent/documenttoken/where.go+++ b/backend/internal/data/ent/documenttoken/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/documenttoken_create.go b/backend/internal/data/ent/documenttoken_create.gosimilarity index 98%rename from backend/ent/documenttoken_create.gorename to backend/internal/data/ent/documenttoken_create.goindex b4585d58..2b290799 100644--- a/backend/ent/documenttoken_create.go+++ b/backend/internal/data/ent/documenttoken_create.go@@ -11,8 +11,8 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken")// DocumentTokenCreate is the builder for creating a DocumentToken entity.diff --git a/backend/ent/documenttoken_delete.go b/backend/internal/data/ent/documenttoken_delete.gosimilarity index 95%rename from backend/ent/documenttoken_delete.gorename to backend/internal/data/ent/documenttoken_delete.goindex fa9b7a11..722ec1b8 100644--- a/backend/ent/documenttoken_delete.go+++ b/backend/internal/data/ent/documenttoken_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// DocumentTokenDelete is the builder for deleting a DocumentToken entity.diff --git a/backend/ent/documenttoken_query.go b/backend/internal/data/ent/documenttoken_query.gosimilarity index 98%rename from backend/ent/documenttoken_query.gorename to backend/internal/data/ent/documenttoken_query.goindex a8f264ec..6c5386c4 100644--- a/backend/ent/documenttoken_query.go+++ b/backend/internal/data/ent/documenttoken_query.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// DocumentTokenQuery is the builder for querying DocumentToken entities.diff --git a/backend/ent/documenttoken_update.go b/backend/internal/data/ent/documenttoken_update.gosimilarity index 98%rename from backend/ent/documenttoken_update.gorename to backend/internal/data/ent/documenttoken_update.goindex dc77dcc5..c6b5e77f 100644--- a/backend/ent/documenttoken_update.go+++ b/backend/internal/data/ent/documenttoken_update.go@@ -12,9 +12,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// DocumentTokenUpdate is the builder for updating DocumentToken entities.diff --git a/backend/ent/ent.go b/backend/internal/data/ent/ent.gosimilarity index 94%rename from backend/ent/ent.gorename to backend/internal/data/ent/ent.goindex 66676f3b..e2552dbb 100644--- a/backend/ent/ent.go+++ b/backend/internal/data/ent/ent.go@@ -10,17 +10,17 @@ import ("entgo.io/ent""entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// ent aliases to avoid import conflicts in user's code.diff --git a/backend/ent/enttest/enttest.go b/backend/internal/data/ent/enttest/enttest.gosimilarity index 90%rename from backend/ent/enttest/enttest.gorename to backend/internal/data/ent/enttest/enttest.goindex f39fc09d..495bddbe 100644--- a/backend/ent/enttest/enttest.go+++ b/backend/internal/data/ent/enttest/enttest.go@@ -5,12 +5,12 @@ package enttestimport ("context"- "github.com/hay-kot/homebox/backend/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent"// required by schema hooks.- _ "github.com/hay-kot/homebox/backend/ent/runtime"+ _ "github.com/hay-kot/homebox/backend/internal/data/ent/runtime""entgo.io/ent/dialect/sql/schema"- "github.com/hay-kot/homebox/backend/ent/migrate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/migrate")type (diff --git a/backend/ent/external.go b/backend/internal/data/ent/external.gosimilarity index 100%rename from backend/ent/external.gorename to backend/internal/data/ent/external.godiff --git a/backend/ent/generate.go b/backend/internal/data/ent/generate.gosimilarity index 100%rename from backend/ent/generate.gorename to backend/internal/data/ent/generate.godiff --git a/backend/ent/group.go b/backend/internal/data/ent/group.gosimilarity index 99%rename from backend/ent/group.gorename to backend/internal/data/ent/group.goindex 814560cd..8140104e 100644--- a/backend/ent/group.go+++ b/backend/internal/data/ent/group.go@@ -9,7 +9,7 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group")// Group is the model entity for the Group schema.diff --git a/backend/ent/group/group.go b/backend/internal/data/ent/group/group.gosimilarity index 100%rename from backend/ent/group/group.gorename to backend/internal/data/ent/group/group.godiff --git a/backend/ent/group/where.go b/backend/internal/data/ent/group/where.gosimilarity index 99%rename from backend/ent/group/where.gorename to backend/internal/data/ent/group/where.goindex b95fef72..62106cc5 100644--- a/backend/ent/group/where.go+++ b/backend/internal/data/ent/group/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/group_create.go b/backend/internal/data/ent/group_create.gosimilarity index 97%rename from backend/ent/group_create.gorename to backend/internal/data/ent/group_create.goindex cdb46190..37ca7394 100644--- a/backend/ent/group_create.go+++ b/backend/internal/data/ent/group_create.go@@ -11,13 +11,13 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// GroupCreate is the builder for creating a Group entity.diff --git a/backend/ent/group_delete.go b/backend/internal/data/ent/group_delete.gosimilarity index 95%rename from backend/ent/group_delete.gorename to backend/internal/data/ent/group_delete.goindex 23dfa0c1..4bcefc84 100644--- a/backend/ent/group_delete.go+++ b/backend/internal/data/ent/group_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// GroupDelete is the builder for deleting a Group entity.diff --git a/backend/ent/group_query.go b/backend/internal/data/ent/group_query.gosimilarity index 98%rename from backend/ent/group_query.gorename to backend/internal/data/ent/group_query.goindex 13bfd9b4..796f81d5 100644--- a/backend/ent/group_query.go+++ b/backend/internal/data/ent/group_query.go@@ -12,14 +12,14 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// GroupQuery is the builder for querying Group entities.diff --git a/backend/ent/group_update.go b/backend/internal/data/ent/group_update.gosimilarity index 98%rename from backend/ent/group_update.gorename to backend/internal/data/ent/group_update.goindex 6400c1bf..bc4dbf98 100644--- a/backend/ent/group_update.go+++ b/backend/internal/data/ent/group_update.go@@ -12,14 +12,14 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// GroupUpdate is the builder for updating Group entities.diff --git a/backend/ent/groupinvitationtoken.go b/backend/internal/data/ent/groupinvitationtoken.gosimilarity index 98%rename from backend/ent/groupinvitationtoken.gorename to backend/internal/data/ent/groupinvitationtoken.goindex 50346d84..248e40f4 100644--- a/backend/ent/groupinvitationtoken.go+++ b/backend/internal/data/ent/groupinvitationtoken.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken")// GroupInvitationToken is the model entity for the GroupInvitationToken schema.diff --git a/backend/ent/groupinvitationtoken/groupinvitationtoken.go b/backend/internal/data/ent/groupinvitationtoken/groupinvitationtoken.gosimilarity index 100%rename from backend/ent/groupinvitationtoken/groupinvitationtoken.gorename to backend/internal/data/ent/groupinvitationtoken/groupinvitationtoken.godiff --git a/backend/ent/groupinvitationtoken/where.go b/backend/internal/data/ent/groupinvitationtoken/where.gosimilarity index 99%rename from backend/ent/groupinvitationtoken/where.gorename to backend/internal/data/ent/groupinvitationtoken/where.goindex a613e6aa..bf4ccaa9 100644--- a/backend/ent/groupinvitationtoken/where.go+++ b/backend/internal/data/ent/groupinvitationtoken/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/groupinvitationtoken_create.go b/backend/internal/data/ent/groupinvitationtoken_create.gosimilarity index 98%rename from backend/ent/groupinvitationtoken_create.gorename to backend/internal/data/ent/groupinvitationtoken_create.goindex b36d623d..34a3f483 100644--- a/backend/ent/groupinvitationtoken_create.go+++ b/backend/internal/data/ent/groupinvitationtoken_create.go@@ -11,8 +11,8 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken")// GroupInvitationTokenCreate is the builder for creating a GroupInvitationToken entity.diff --git a/backend/ent/groupinvitationtoken_delete.go b/backend/internal/data/ent/groupinvitationtoken_delete.gosimilarity index 95%rename from backend/ent/groupinvitationtoken_delete.gorename to backend/internal/data/ent/groupinvitationtoken_delete.goindex 42fad8b7..4fa2ceb6 100644--- a/backend/ent/groupinvitationtoken_delete.go+++ b/backend/internal/data/ent/groupinvitationtoken_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// GroupInvitationTokenDelete is the builder for deleting a GroupInvitationToken entity.diff --git a/backend/ent/groupinvitationtoken_query.go b/backend/internal/data/ent/groupinvitationtoken_query.gosimilarity index 98%rename from backend/ent/groupinvitationtoken_query.gorename to backend/internal/data/ent/groupinvitationtoken_query.goindex ea380b09..4e8536b6 100644--- a/backend/ent/groupinvitationtoken_query.go+++ b/backend/internal/data/ent/groupinvitationtoken_query.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// GroupInvitationTokenQuery is the builder for querying GroupInvitationToken entities.diff --git a/backend/ent/groupinvitationtoken_update.go b/backend/internal/data/ent/groupinvitationtoken_update.gosimilarity index 98%rename from backend/ent/groupinvitationtoken_update.gorename to backend/internal/data/ent/groupinvitationtoken_update.goindex 3459c4e0..33cbef2f 100644--- a/backend/ent/groupinvitationtoken_update.go+++ b/backend/internal/data/ent/groupinvitationtoken_update.go@@ -12,9 +12,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// GroupInvitationTokenUpdate is the builder for updating GroupInvitationToken entities.diff --git a/backend/ent/has_id.go b/backend/internal/data/ent/has_id.gosimilarity index 100%rename from backend/ent/has_id.gorename to backend/internal/data/ent/has_id.godiff --git a/backend/ent/hook/hook.go b/backend/internal/data/ent/hook/hook.gosimilarity index 99%rename from backend/ent/hook/hook.gorename to backend/internal/data/ent/hook/hook.goindex 0fbd6d1e..c0a7378a 100644--- a/backend/ent/hook/hook.go+++ b/backend/internal/data/ent/hook/hook.go@@ -6,7 +6,7 @@ import ("context""fmt"- "github.com/hay-kot/homebox/backend/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent")// The AttachmentFunc type is an adapter to allow the use of ordinarydiff --git a/backend/ent/item.go b/backend/internal/data/ent/item.gosimilarity index 98%rename from backend/ent/item.gorename to backend/internal/data/ent/item.goindex c1b1effd..d9d66b45 100644--- a/backend/ent/item.go+++ b/backend/internal/data/ent/item.go@@ -9,9 +9,9 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location")// Item is the model entity for the Item schema.diff --git a/backend/ent/item/item.go b/backend/internal/data/ent/item/item.gosimilarity index 100%rename from backend/ent/item/item.gorename to backend/internal/data/ent/item/item.godiff --git a/backend/ent/item/where.go b/backend/internal/data/ent/item/where.gosimilarity index 99%rename from backend/ent/item/where.gorename to backend/internal/data/ent/item/where.goindex ec742751..cb4b0d91 100644--- a/backend/ent/item/where.go+++ b/backend/internal/data/ent/item/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/item_create.go b/backend/internal/data/ent/item_create.gosimilarity index 98%rename from backend/ent/item_create.gorename to backend/internal/data/ent/item_create.goindex 6134705b..5b0842dc 100644--- a/backend/ent/item_create.go+++ b/backend/internal/data/ent/item_create.go@@ -11,12 +11,12 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location")// ItemCreate is the builder for creating a Item entity.diff --git a/backend/ent/item_delete.go b/backend/internal/data/ent/item_delete.gosimilarity index 95%rename from backend/ent/item_delete.gorename to backend/internal/data/ent/item_delete.goindex 1f8b6f8b..56b7e030 100644--- a/backend/ent/item_delete.go+++ b/backend/internal/data/ent/item_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ItemDelete is the builder for deleting a Item entity.diff --git a/backend/ent/item_query.go b/backend/internal/data/ent/item_query.gosimilarity index 98%rename from backend/ent/item_query.gorename to backend/internal/data/ent/item_query.goindex e6d1173d..fba0917f 100644--- a/backend/ent/item_query.go+++ b/backend/internal/data/ent/item_query.go@@ -12,13 +12,13 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ItemQuery is the builder for querying Item entities.diff --git a/backend/ent/item_update.go b/backend/internal/data/ent/item_update.gosimilarity index 99%rename from backend/ent/item_update.gorename to backend/internal/data/ent/item_update.goindex 5b08da7e..86dd6dde 100644--- a/backend/ent/item_update.go+++ b/backend/internal/data/ent/item_update.go@@ -12,13 +12,13 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ItemUpdate is the builder for updating Item entities.diff --git a/backend/ent/itemfield.go b/backend/internal/data/ent/itemfield.gosimilarity index 98%rename from backend/ent/itemfield.gorename to backend/internal/data/ent/itemfield.goindex 84db86d5..be68023b 100644--- a/backend/ent/itemfield.go+++ b/backend/internal/data/ent/itemfield.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield")// ItemField is the model entity for the ItemField schema.diff --git a/backend/ent/itemfield/itemfield.go b/backend/internal/data/ent/itemfield/itemfield.gosimilarity index 100%rename from backend/ent/itemfield/itemfield.gorename to backend/internal/data/ent/itemfield/itemfield.godiff --git a/backend/ent/itemfield/where.go b/backend/internal/data/ent/itemfield/where.gosimilarity index 99%rename from backend/ent/itemfield/where.gorename to backend/internal/data/ent/itemfield/where.goindex 39c27344..2af2d7a7 100644--- a/backend/ent/itemfield/where.go+++ b/backend/internal/data/ent/itemfield/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/itemfield_create.go b/backend/internal/data/ent/itemfield_create.gosimilarity index 99%rename from backend/ent/itemfield_create.gorename to backend/internal/data/ent/itemfield_create.goindex ad9fd96a..2a007495 100644--- a/backend/ent/itemfield_create.go+++ b/backend/internal/data/ent/itemfield_create.go@@ -11,8 +11,8 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield")// ItemFieldCreate is the builder for creating a ItemField entity.diff --git a/backend/ent/itemfield_delete.go b/backend/internal/data/ent/itemfield_delete.gosimilarity index 95%rename from backend/ent/itemfield_delete.gorename to backend/internal/data/ent/itemfield_delete.goindex e5ba38f1..e1933d69 100644--- a/backend/ent/itemfield_delete.go+++ b/backend/internal/data/ent/itemfield_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ItemFieldDelete is the builder for deleting a ItemField entity.diff --git a/backend/ent/itemfield_query.go b/backend/internal/data/ent/itemfield_query.gosimilarity index 98%rename from backend/ent/itemfield_query.gorename to backend/internal/data/ent/itemfield_query.goindex c72441ea..fb9a5ea0 100644--- a/backend/ent/itemfield_query.go+++ b/backend/internal/data/ent/itemfield_query.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ItemFieldQuery is the builder for querying ItemField entities.diff --git a/backend/ent/itemfield_update.go b/backend/internal/data/ent/itemfield_update.gosimilarity index 99%rename from backend/ent/itemfield_update.gorename to backend/internal/data/ent/itemfield_update.goindex cac8fed5..6b89324c 100644--- a/backend/ent/itemfield_update.go+++ b/backend/internal/data/ent/itemfield_update.go@@ -12,9 +12,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ItemFieldUpdate is the builder for updating ItemField entities.diff --git a/backend/ent/label.go b/backend/internal/data/ent/label.gosimilarity index 98%rename from backend/ent/label.gorename to backend/internal/data/ent/label.goindex 73e07149..9e65bfe1 100644--- a/backend/ent/label.go+++ b/backend/internal/data/ent/label.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label")// Label is the model entity for the Label schema.diff --git a/backend/ent/label/label.go b/backend/internal/data/ent/label/label.gosimilarity index 100%rename from backend/ent/label/label.gorename to backend/internal/data/ent/label/label.godiff --git a/backend/ent/label/where.go b/backend/internal/data/ent/label/where.gosimilarity index 99%rename from backend/ent/label/where.gorename to backend/internal/data/ent/label/where.goindex 05d24db3..9279ee7d 100644--- a/backend/ent/label/where.go+++ b/backend/internal/data/ent/label/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/label_create.go b/backend/internal/data/ent/label_create.gosimilarity index 98%rename from backend/ent/label_create.gorename to backend/internal/data/ent/label_create.goindex 7330747c..a000e359 100644--- a/backend/ent/label_create.go+++ b/backend/internal/data/ent/label_create.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label")// LabelCreate is the builder for creating a Label entity.diff --git a/backend/ent/label_delete.go b/backend/internal/data/ent/label_delete.gosimilarity index 95%rename from backend/ent/label_delete.gorename to backend/internal/data/ent/label_delete.goindex aef8be05..28e103ca 100644--- a/backend/ent/label_delete.go+++ b/backend/internal/data/ent/label_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// LabelDelete is the builder for deleting a Label entity.diff --git a/backend/ent/label_query.go b/backend/internal/data/ent/label_query.gosimilarity index 98%rename from backend/ent/label_query.gorename to backend/internal/data/ent/label_query.goindex 58fa5345..fc53ec49 100644--- a/backend/ent/label_query.go+++ b/backend/internal/data/ent/label_query.go@@ -12,10 +12,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// LabelQuery is the builder for querying Label entities.diff --git a/backend/ent/label_update.go b/backend/internal/data/ent/label_update.gosimilarity index 98%rename from backend/ent/label_update.gorename to backend/internal/data/ent/label_update.goindex ef0af158..16f4a0c9 100644--- a/backend/ent/label_update.go+++ b/backend/internal/data/ent/label_update.go@@ -12,10 +12,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// LabelUpdate is the builder for updating Label entities.diff --git a/backend/ent/location.go b/backend/internal/data/ent/location.gosimilarity index 98%rename from backend/ent/location.gorename to backend/internal/data/ent/location.goindex 337126b9..67abd30b 100644--- a/backend/ent/location.go+++ b/backend/internal/data/ent/location.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location")// Location is the model entity for the Location schema.diff --git a/backend/ent/location/location.go b/backend/internal/data/ent/location/location.gosimilarity index 100%rename from backend/ent/location/location.gorename to backend/internal/data/ent/location/location.godiff --git a/backend/ent/location/where.go b/backend/internal/data/ent/location/where.gosimilarity index 99%rename from backend/ent/location/where.gorename to backend/internal/data/ent/location/where.goindex 20738b73..73f28bd6 100644--- a/backend/ent/location/where.go+++ b/backend/internal/data/ent/location/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/location_create.go b/backend/internal/data/ent/location_create.gosimilarity index 98%rename from backend/ent/location_create.gorename to backend/internal/data/ent/location_create.goindex ceff804e..35081c2d 100644--- a/backend/ent/location_create.go+++ b/backend/internal/data/ent/location_create.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location")// LocationCreate is the builder for creating a Location entity.diff --git a/backend/ent/location_delete.go b/backend/internal/data/ent/location_delete.gosimilarity index 95%rename from backend/ent/location_delete.gorename to backend/internal/data/ent/location_delete.goindex 8bc6db37..7fd8e848 100644--- a/backend/ent/location_delete.go+++ b/backend/internal/data/ent/location_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// LocationDelete is the builder for deleting a Location entity.diff --git a/backend/ent/location_query.go b/backend/internal/data/ent/location_query.gosimilarity index 98%rename from backend/ent/location_query.gorename to backend/internal/data/ent/location_query.goindex 9cf0b552..ff3014b6 100644--- a/backend/ent/location_query.go+++ b/backend/internal/data/ent/location_query.go@@ -12,10 +12,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// LocationQuery is the builder for querying Location entities.diff --git a/backend/ent/location_update.go b/backend/internal/data/ent/location_update.gosimilarity index 99%rename from backend/ent/location_update.gorename to backend/internal/data/ent/location_update.goindex 785036a0..eaeb530c 100644--- a/backend/ent/location_update.go+++ b/backend/internal/data/ent/location_update.go@@ -12,10 +12,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// LocationUpdate is the builder for updating Location entities.diff --git a/backend/ent/migrate/migrate.go b/backend/internal/data/ent/migrate/migrate.gosimilarity index 100%rename from backend/ent/migrate/migrate.gorename to backend/internal/data/ent/migrate/migrate.godiff --git a/backend/ent/migrate/schema.go b/backend/internal/data/ent/migrate/schema.gosimilarity index 100%rename from backend/ent/migrate/schema.gorename to backend/internal/data/ent/migrate/schema.godiff --git a/backend/ent/mutation.go b/backend/internal/data/ent/mutation.gosimilarity index 99%rename from backend/ent/mutation.gorename to backend/internal/data/ent/mutation.goindex eb2e8538..c2457199 100644--- a/backend/ent/mutation.go+++ b/backend/internal/data/ent/mutation.go@@ -10,18 +10,18 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user""entgo.io/ent")diff --git a/backend/ent/predicate/predicate.go b/backend/internal/data/ent/predicate/predicate.gosimilarity index 100%rename from backend/ent/predicate/predicate.gorename to backend/internal/data/ent/predicate/predicate.godiff --git a/backend/ent/runtime.go b/backend/internal/data/ent/runtime.gosimilarity index 97%rename from backend/ent/runtime.gorename to backend/internal/data/ent/runtime.goindex bfa73d1d..3929dab5 100644--- a/backend/ent/runtime.go+++ b/backend/internal/data/ent/runtime.go@@ -6,18 +6,18 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/attachment"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/documenttoken"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/schema"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// The init function reads all schema descriptors with runtime codediff --git a/backend/ent/runtime/runtime.go b/backend/internal/data/ent/runtime/runtime.gosimilarity index 86%rename from backend/ent/runtime/runtime.gorename to backend/internal/data/ent/runtime/runtime.goindex 8dd480b2..9be6acb0 100644--- a/backend/ent/runtime/runtime.go+++ b/backend/internal/data/ent/runtime/runtime.go@@ -2,7 +2,7 @@package runtime-// The schema-stitching logic is generated in github.com/hay-kot/homebox/backend/ent/runtime.go+// The schema-stitching logic is generated in github.com/hay-kot/homebox/backend/internal/data/ent/runtime.goconst (Version = "v0.11.3" // Version of ent codegen.diff --git a/backend/ent/schema/attachment.go b/backend/internal/data/ent/schema/attachment.gosimilarity index 91%rename from backend/ent/schema/attachment.gorename to backend/internal/data/ent/schema/attachment.goindex 7dc27d31..7f4673ad 100644--- a/backend/ent/schema/attachment.go+++ b/backend/internal/data/ent/schema/attachment.go@@ -4,7 +4,7 @@ import ("entgo.io/ent""entgo.io/ent/schema/edge""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// Attachment holds the schema definition for the Attachment entity.diff --git a/backend/ent/schema/auth_tokens.go b/backend/internal/data/ent/schema/auth_tokens.gosimilarity index 92%rename from backend/ent/schema/auth_tokens.gorename to backend/internal/data/ent/schema/auth_tokens.goindex 41beafa4..0cfd4d14 100644--- a/backend/ent/schema/auth_tokens.go+++ b/backend/internal/data/ent/schema/auth_tokens.go@@ -7,7 +7,7 @@ import ("entgo.io/ent/schema/edge""entgo.io/ent/schema/field""entgo.io/ent/schema/index"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// AuthTokens holds the schema definition for the AuthTokens entity.diff --git a/backend/ent/schema/document.go b/backend/internal/data/ent/schema/document.gosimilarity index 93%rename from backend/ent/schema/document.gorename to backend/internal/data/ent/schema/document.goindex f6b2c575..2293c39a 100644--- a/backend/ent/schema/document.go+++ b/backend/internal/data/ent/schema/document.go@@ -5,7 +5,7 @@ import ("entgo.io/ent/dialect/entsql""entgo.io/ent/schema/edge""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// Document holds the schema definition for the Document entity.diff --git a/backend/ent/schema/document_token.go b/backend/internal/data/ent/schema/document_token.gosimilarity index 92%rename from backend/ent/schema/document_token.gorename to backend/internal/data/ent/schema/document_token.goindex 74239960..c5ec72f4 100644--- a/backend/ent/schema/document_token.go+++ b/backend/internal/data/ent/schema/document_token.go@@ -7,7 +7,7 @@ import ("entgo.io/ent/schema/edge""entgo.io/ent/schema/field""entgo.io/ent/schema/index"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// DocumentToken holds the schema definition for the DocumentToken entity.diff --git a/backend/ent/schema/group.go b/backend/internal/data/ent/schema/group.gosimilarity index 94%rename from backend/ent/schema/group.gorename to backend/internal/data/ent/schema/group.goindex a9d51ed7..efd706cf 100644--- a/backend/ent/schema/group.go+++ b/backend/internal/data/ent/schema/group.go@@ -5,7 +5,7 @@ import ("entgo.io/ent/dialect/entsql""entgo.io/ent/schema/edge""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// Group holds the schema definition for the Group entity.diff --git a/backend/ent/schema/group_invitation_token.go b/backend/internal/data/ent/schema/group_invitation_token.gosimilarity index 92%rename from backend/ent/schema/group_invitation_token.gorename to backend/internal/data/ent/schema/group_invitation_token.goindex 6ba41cde..1150db88 100644--- a/backend/ent/schema/group_invitation_token.go+++ b/backend/internal/data/ent/schema/group_invitation_token.go@@ -6,7 +6,7 @@ import ("entgo.io/ent""entgo.io/ent/schema/edge""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// GroupInvitationToken holds the schema definition for the GroupInvitationToken entity.diff --git a/backend/ent/schema/item.go b/backend/internal/data/ent/schema/item.gosimilarity index 97%rename from backend/ent/schema/item.gorename to backend/internal/data/ent/schema/item.goindex 25531d0d..17021a51 100644--- a/backend/ent/schema/item.go+++ b/backend/internal/data/ent/schema/item.go@@ -6,7 +6,7 @@ import ("entgo.io/ent/schema/edge""entgo.io/ent/schema/field""entgo.io/ent/schema/index"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// Item holds the schema definition for the Item entity.diff --git a/backend/ent/schema/item_field.go b/backend/internal/data/ent/schema/item_field.gosimilarity index 92%rename from backend/ent/schema/item_field.gorename to backend/internal/data/ent/schema/item_field.goindex 56be98a3..405b99c4 100644--- a/backend/ent/schema/item_field.go+++ b/backend/internal/data/ent/schema/item_field.go@@ -6,7 +6,7 @@ import ("entgo.io/ent""entgo.io/ent/schema/edge""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// ItemField holds the schema definition for the ItemField entity.diff --git a/backend/ent/schema/label.go b/backend/internal/data/ent/schema/label.gosimilarity index 90%rename from backend/ent/schema/label.gorename to backend/internal/data/ent/schema/label.goindex a8eb8d28..72d60784 100644--- a/backend/ent/schema/label.go+++ b/backend/internal/data/ent/schema/label.go@@ -4,7 +4,7 @@ import ("entgo.io/ent""entgo.io/ent/schema/edge""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// Label holds the schema definition for the Label entity.diff --git a/backend/ent/schema/location.go b/backend/internal/data/ent/schema/location.gosimilarity index 91%rename from backend/ent/schema/location.gorename to backend/internal/data/ent/schema/location.goindex e8f22374..b3142b4f 100644--- a/backend/ent/schema/location.go+++ b/backend/internal/data/ent/schema/location.go@@ -4,7 +4,7 @@ import ("entgo.io/ent""entgo.io/ent/dialect/entsql""entgo.io/ent/schema/edge"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// Location holds the schema definition for the Location entity.diff --git a/backend/ent/schema/mixins/base.go b/backend/internal/data/ent/schema/mixins/base.gosimilarity index 100%rename from backend/ent/schema/mixins/base.gorename to backend/internal/data/ent/schema/mixins/base.godiff --git a/backend/ent/schema/templates/has_id.tmpl b/backend/internal/data/ent/schema/templates/has_id.tmplsimilarity index 100%rename from backend/ent/schema/templates/has_id.tmplrename to backend/internal/data/ent/schema/templates/has_id.tmpldiff --git a/backend/ent/schema/user.go b/backend/internal/data/ent/schema/user.gosimilarity index 93%rename from backend/ent/schema/user.gorename to backend/internal/data/ent/schema/user.goindex d522ddb7..b3342a8c 100644--- a/backend/ent/schema/user.go+++ b/backend/internal/data/ent/schema/user.go@@ -5,7 +5,7 @@ import ("entgo.io/ent/dialect/entsql""entgo.io/ent/schema/edge""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/schema/mixins"+ "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins")// User holds the schema definition for the User entity.diff --git a/backend/ent/tx.go b/backend/internal/data/ent/tx.gosimilarity index 100%rename from backend/ent/tx.gorename to backend/internal/data/ent/tx.godiff --git a/backend/ent/user.go b/backend/internal/data/ent/user.gosimilarity index 98%rename from backend/ent/user.gorename to backend/internal/data/ent/user.goindex 547e21fe..48dbdcb9 100644--- a/backend/ent/user.go+++ b/backend/internal/data/ent/user.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// User is the model entity for the User schema.diff --git a/backend/ent/user/user.go b/backend/internal/data/ent/user/user.gosimilarity index 100%rename from backend/ent/user/user.gorename to backend/internal/data/ent/user/user.godiff --git a/backend/ent/user/where.go b/backend/internal/data/ent/user/where.gosimilarity index 99%rename from backend/ent/user/where.gorename to backend/internal/data/ent/user/where.goindex df4adbb9..567187e7 100644--- a/backend/ent/user/where.go+++ b/backend/internal/data/ent/user/where.go@@ -8,7 +8,7 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")// ID filters vertices based on their ID field.diff --git a/backend/ent/user_create.go b/backend/internal/data/ent/user_create.gosimilarity index 98%rename from backend/ent/user_create.gorename to backend/internal/data/ent/user_create.goindex 58352445..317b43a1 100644--- a/backend/ent/user_create.go+++ b/backend/internal/data/ent/user_create.go@@ -11,9 +11,9 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// UserCreate is the builder for creating a User entity.diff --git a/backend/ent/user_delete.go b/backend/internal/data/ent/user_delete.gosimilarity index 95%rename from backend/ent/user_delete.gorename to backend/internal/data/ent/user_delete.goindex 6d8b9492..9013f6f6 100644--- a/backend/ent/user_delete.go+++ b/backend/internal/data/ent/user_delete.go@@ -9,8 +9,8 @@ import ("entgo.io/ent/dialect/sql""entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// UserDelete is the builder for deleting a User entity.diff --git a/backend/ent/user_query.go b/backend/internal/data/ent/user_query.gosimilarity index 98%rename from backend/ent/user_query.gorename to backend/internal/data/ent/user_query.goindex 09d951d4..2178bd32 100644--- a/backend/ent/user_query.go+++ b/backend/internal/data/ent/user_query.go@@ -12,10 +12,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// UserQuery is the builder for querying User entities.diff --git a/backend/ent/user_update.go b/backend/internal/data/ent/user_update.gosimilarity index 98%rename from backend/ent/user_update.gorename to backend/internal/data/ent/user_update.goindex 93163607..bfe8d3b4 100644--- a/backend/ent/user_update.go+++ b/backend/internal/data/ent/user_update.go@@ -12,10 +12,10 @@ import ("entgo.io/ent/dialect/sql/sqlgraph""entgo.io/ent/schema/field""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent/authtokens"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/predicate"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")// UserUpdate is the builder for updating User entities.diff --git a/backend/internal/migrations/migrations.go b/backend/internal/data/migrations/migrations.gosimilarity index 100%rename from backend/internal/migrations/migrations.gorename to backend/internal/data/migrations/migrations.godiff --git a/backend/internal/migrations/migrations/20220929052825_init.sql b/backend/internal/data/migrations/migrations/20220929052825_init.sqlsimilarity index 100%rename from backend/internal/migrations/migrations/20220929052825_init.sqlrename to backend/internal/data/migrations/migrations/20220929052825_init.sqldiff --git a/backend/internal/migrations/migrations/20221001210956_group_invitations.sql b/backend/internal/data/migrations/migrations/20221001210956_group_invitations.sqlsimilarity index 100%rename from backend/internal/migrations/migrations/20221001210956_group_invitations.sqlrename to backend/internal/data/migrations/migrations/20221001210956_group_invitations.sqldiff --git a/backend/internal/migrations/migrations/20221009173029_add_user_roles.sql b/backend/internal/data/migrations/migrations/20221009173029_add_user_roles.sqlsimilarity index 100%rename from backend/internal/migrations/migrations/20221009173029_add_user_roles.sqlrename to backend/internal/data/migrations/migrations/20221009173029_add_user_roles.sqldiff --git a/backend/internal/migrations/migrations/20221020043305_allow_nesting_types.sql b/backend/internal/data/migrations/migrations/20221020043305_allow_nesting_types.sqlsimilarity index 100%rename from backend/internal/migrations/migrations/20221020043305_allow_nesting_types.sqlrename to backend/internal/data/migrations/migrations/20221020043305_allow_nesting_types.sqldiff --git a/backend/internal/migrations/migrations/atlas.sum b/backend/internal/data/migrations/migrations/atlas.sumsimilarity index 100%rename from backend/internal/migrations/migrations/atlas.sumrename to backend/internal/data/migrations/migrations/atlas.sumdiff --git a/backend/internal/repo/id_set.go b/backend/internal/data/repo/id_set.gosimilarity index 100%rename from backend/internal/repo/id_set.gorename to backend/internal/data/repo/id_set.godiff --git a/backend/internal/repo/main_test.go b/backend/internal/data/repo/main_test.gosimilarity index 94%rename from backend/internal/repo/main_test.gorename to backend/internal/data/repo/main_test.goindex 92fe4be1..221fbd5c 100644--- a/backend/internal/repo/main_test.go+++ b/backend/internal/data/repo/main_test.go@@ -8,7 +8,7 @@ import ("testing""time"- "github.com/hay-kot/homebox/backend/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent""github.com/hay-kot/homebox/backend/pkgs/faker"_ "github.com/mattn/go-sqlite3")diff --git a/backend/internal/repo/map_helpers.go b/backend/internal/data/repo/map_helpers.gosimilarity index 100%rename from backend/internal/repo/map_helpers.gorename to backend/internal/data/repo/map_helpers.godiff --git a/backend/internal/repo/pagination.go b/backend/internal/data/repo/pagination.gosimilarity index 100%rename from backend/internal/repo/pagination.gorename to backend/internal/data/repo/pagination.godiff --git a/backend/internal/repo/repo_document_tokens.go b/backend/internal/data/repo/repo_document_tokens.gosimilarity index 92%rename from backend/internal/repo/repo_document_tokens.gorename to backend/internal/data/repo/repo_document_tokens.goindex 903240c0..018ea618 100644--- a/backend/internal/repo/repo_document_tokens.go+++ b/backend/internal/data/repo/repo_document_tokens.go@@ -5,8 +5,8 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken")// DocumentTokensRepository is a repository for Document entitydiff --git a/backend/internal/repo/repo_document_tokens_test.go b/backend/internal/data/repo/repo_document_tokens_test.gosimilarity index 96%rename from backend/internal/repo/repo_document_tokens_test.gorename to backend/internal/data/repo/repo_document_tokens_test.goindex 34f0a17b..6646eca1 100644--- a/backend/internal/repo/repo_document_tokens_test.go+++ b/backend/internal/data/repo/repo_document_tokens_test.go@@ -6,8 +6,8 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/documenttoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/documenttoken""github.com/stretchr/testify/assert")diff --git a/backend/internal/repo/repo_documents.go b/backend/internal/data/repo/repo_documents.gosimilarity index 92%rename from backend/internal/repo/repo_documents.gorename to backend/internal/data/repo/repo_documents.goindex a9a5666b..abe340d9 100644--- a/backend/internal/repo/repo_documents.go+++ b/backend/internal/data/repo/repo_documents.go@@ -8,9 +8,9 @@ import ("path/filepath""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/document"- "github.com/hay-kot/homebox/backend/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/document"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group""github.com/hay-kot/homebox/backend/pkgs/pathlib")diff --git a/backend/internal/repo/repo_documents_test.go b/backend/internal/data/repo/repo_documents_test.gosimilarity index 97%rename from backend/internal/repo/repo_documents_test.gorename to backend/internal/data/repo/repo_documents_test.goindex 06e631c6..b58b3bb0 100644--- a/backend/internal/repo/repo_documents_test.go+++ b/backend/internal/data/repo/repo_documents_test.go@@ -9,7 +9,7 @@ import ("testing""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent""github.com/stretchr/testify/assert")diff --git a/backend/internal/repo/repo_group.go b/backend/internal/data/repo/repo_group.gosimilarity index 90%rename from backend/internal/repo/repo_group.gorename to backend/internal/data/repo/repo_group.goindex ac0e071f..fa5b6b86 100644--- a/backend/internal/repo/repo_group.go+++ b/backend/internal/data/repo/repo_group.go@@ -2,12 +2,13 @@ package repoimport ("context"+ "strings""time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/groupinvitationtoken"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/groupinvitationtoken")type GroupRepository struct {@@ -52,7 +53,7 @@ func mapToGroup(g *ent.Group) Group {Name: g.Name,CreatedAt: g.CreatedAt,UpdatedAt: g.UpdatedAt,- Currency: g.Currency.String(),+ Currency: strings.ToUpper(g.Currency.String()),}}@@ -76,7 +77,7 @@ func (r *GroupRepository) GroupCreate(ctx context.Context, name string) (Group,}func (r *GroupRepository) GroupUpdate(ctx context.Context, ID uuid.UUID, data GroupUpdate) (Group, error) {- currency := group.Currency(data.Currency)+ currency := group.Currency(strings.ToLower(data.Currency))entity, err := r.db.Group.UpdateOneID(ID).SetName(data.Name).diff --git a/backend/internal/repo/repo_group_test.go b/backend/internal/data/repo/repo_group_test.gosimilarity index 95%rename from backend/internal/repo/repo_group_test.gorename to backend/internal/data/repo/repo_group_test.goindex 5f3faaf5..941e06ca 100644--- a/backend/internal/repo/repo_group_test.go+++ b/backend/internal/data/repo/repo_group_test.go@@ -29,5 +29,5 @@ func Test_Group_Update(t *testing.T) {})assert.NoError(t, err)assert.Equal(t, "test2", g.Name)- assert.Equal(t, "eur", g.Currency)+ assert.Equal(t, "EUR", g.Currency)}diff --git a/backend/internal/repo/repo_item_attachments.go b/backend/internal/data/repo/repo_item_attachments.gosimilarity index 94%rename from backend/internal/repo/repo_item_attachments.gorename to backend/internal/data/repo/repo_item_attachments.goindex 9b0f810c..1e2ef7b0 100644--- a/backend/internal/repo/repo_item_attachments.go+++ b/backend/internal/data/repo/repo_item_attachments.go@@ -5,8 +5,8 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment")// AttachmentRepo is a repository for Attachments table that links Items to Documentsdiff --git a/backend/internal/repo/repo_item_attachments_test.go b/backend/internal/data/repo/repo_item_attachments_test.gosimilarity index 95%rename from backend/internal/repo/repo_item_attachments_test.gorename to backend/internal/data/repo/repo_item_attachments_test.goindex e8610018..15f70c8e 100644--- a/backend/internal/repo/repo_item_attachments_test.go+++ b/backend/internal/data/repo/repo_item_attachments_test.go@@ -5,8 +5,8 @@ import ("testing""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/attachment"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/attachment""github.com/stretchr/testify/assert")diff --git a/backend/internal/repo/repo_items.go b/backend/internal/data/repo/repo_items.gosimilarity index 96%rename from backend/internal/repo/repo_items.gorename to backend/internal/data/repo/repo_items.goindex 27ddc4ca..8eefb5fa 100644--- a/backend/internal/repo/repo_items.go+++ b/backend/internal/data/repo/repo_items.go@@ -5,13 +5,13 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/item"- "github.com/hay-kot/homebox/backend/ent/itemfield"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/item"+ "github.com/hay-kot/homebox/backend/internal/data/ent/itemfield"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")type ItemsRepository struct {diff --git a/backend/internal/repo/repo_items_test.go b/backend/internal/data/repo/repo_items_test.gosimilarity index 100%rename from backend/internal/repo/repo_items_test.gorename to backend/internal/data/repo/repo_items_test.godiff --git a/backend/internal/repo/repo_labels.go b/backend/internal/data/repo/repo_labels.gosimilarity index 73%rename from backend/internal/repo/repo_labels.gorename to backend/internal/data/repo/repo_labels.goindex b899d68e..353df172 100644--- a/backend/internal/repo/repo_labels.go+++ b/backend/internal/data/repo/repo_labels.go@@ -5,10 +5,10 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/label"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/label"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")type LabelRepository struct {@@ -106,13 +106,30 @@ func (r *LabelRepository) Create(ctx context.Context, groupdId uuid.UUID, data Lreturn mapLabelOut(label), err}-func (r *LabelRepository) Update(ctx context.Context, data LabelUpdate) (LabelOut, error) {- _, err := r.db.Label.UpdateOneID(data.ID).+func (r *LabelRepository) update(ctx context.Context, data LabelUpdate, where ...predicate.Label) (int, error) {+ if len(where) == 0 {+ panic("empty where not supported empty")+ }++ return r.db.Label.Update().+ Where(where...).SetName(data.Name).SetDescription(data.Description).SetColor(data.Color).Save(ctx)+}++func (r *LabelRepository) Update(ctx context.Context, data LabelUpdate) (LabelOut, error) {+ _, err := r.update(ctx, data, label.ID(data.ID))+ if err != nil {+ return LabelOut{}, err+ }++ return r.GetOne(ctx, data.ID)+}+func (r *LabelRepository) UpdateByGroup(ctx context.Context, GID uuid.UUID, data LabelUpdate) (LabelOut, error) {+ _, err := r.update(ctx, data, label.ID(data.ID), label.HasGroupWith(group.ID(GID)))if err != nil {return LabelOut{}, err}@@ -123,3 +140,13 @@ func (r *LabelRepository) Update(ctx context.Context, data LabelUpdate) (LabelOufunc (r *LabelRepository) Delete(ctx context.Context, id uuid.UUID) error {return r.db.Label.DeleteOneID(id).Exec(ctx)}++func (r *LabelRepository) DeleteByGroup(ctx context.Context, gid, id uuid.UUID) error {+ _, err := r.db.Label.Delete().+ Where(+ label.ID(id),+ label.HasGroupWith(group.ID(gid)),+ ).Exec(ctx)++ return err+}diff --git a/backend/internal/repo/repo_labels_test.go b/backend/internal/data/repo/repo_labels_test.gosimilarity index 100%rename from backend/internal/repo/repo_labels_test.gorename to backend/internal/data/repo/repo_labels_test.godiff --git a/backend/internal/repo/repo_locations.go b/backend/internal/data/repo/repo_locations.gosimilarity index 77%rename from backend/internal/repo/repo_locations.gorename to backend/internal/data/repo/repo_locations.goindex f927431d..9e5f36d4 100644--- a/backend/internal/repo/repo_locations.go+++ b/backend/internal/data/repo/repo_locations.go@@ -5,10 +5,10 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/group"- "github.com/hay-kot/homebox/backend/ent/location"- "github.com/hay-kot/homebox/backend/ent/predicate"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/group"+ "github.com/hay-kot/homebox/backend/internal/data/ent/location"+ "github.com/hay-kot/homebox/backend/internal/data/ent/predicate")type LocationRepository struct {@@ -154,23 +154,24 @@ func (r *LocationRepository) GetOneByGroup(ctx context.Context, GID, ID uuid.UUIreturn r.getOne(ctx, location.ID(ID), location.HasGroupWith(group.ID(GID)))}-func (r *LocationRepository) Create(ctx context.Context, gid uuid.UUID, data LocationCreate) (LocationOut, error) {+func (r *LocationRepository) Create(ctx context.Context, GID uuid.UUID, data LocationCreate) (LocationOut, error) {location, err := r.db.Location.Create().SetName(data.Name).SetDescription(data.Description).- SetGroupID(gid).+ SetGroupID(GID).Save(ctx)if err != nil {return LocationOut{}, err}- location.Edges.Group = &ent.Group{ID: gid} // bootstrap group ID+ location.Edges.Group = &ent.Group{ID: GID} // bootstrap group IDreturn mapLocationOut(location), nil}-func (r *LocationRepository) Update(ctx context.Context, data LocationUpdate) (LocationOut, error) {- q := r.db.Location.UpdateOneID(data.ID).+func (r *LocationRepository) update(ctx context.Context, data LocationUpdate, where ...predicate.Location) (LocationOut, error) {+ q := r.db.Location.Update().+ Where(where...).SetName(data.Name).SetDescription(data.Description)@@ -181,7 +182,6 @@ func (r *LocationRepository) Update(ctx context.Context, data LocationUpdate) (L}_, err := q.Save(ctx)-if err != nil {return LocationOut{}, err}@@ -189,6 +189,19 @@ func (r *LocationRepository) Update(ctx context.Context, data LocationUpdate) (Lreturn r.Get(ctx, data.ID)}-func (r *LocationRepository) Delete(ctx context.Context, id uuid.UUID) error {- return r.db.Location.DeleteOneID(id).Exec(ctx)+func (r *LocationRepository) Update(ctx context.Context, data LocationUpdate) (LocationOut, error) {+ return r.update(ctx, data, location.ID(data.ID))+}++func (r *LocationRepository) UpdateOneByGroup(ctx context.Context, GID, ID uuid.UUID, data LocationUpdate) (LocationOut, error) {+ return r.update(ctx, data, location.ID(ID), location.HasGroupWith(group.ID(GID)))+}++func (r *LocationRepository) Delete(ctx context.Context, ID uuid.UUID) error {+ return r.db.Location.DeleteOneID(ID).Exec(ctx)+}++func (r *LocationRepository) DeleteByGroup(ctx context.Context, GID, ID uuid.UUID) error {+ _, err := r.db.Location.Delete().Where(location.ID(ID), location.HasGroupWith(group.ID(GID))).Exec(ctx)+ return err}diff --git a/backend/internal/repo/repo_locations_test.go b/backend/internal/data/repo/repo_locations_test.gosimilarity index 100%rename from backend/internal/repo/repo_locations_test.gorename to backend/internal/data/repo/repo_locations_test.godiff --git a/backend/internal/repo/repo_tokens.go b/backend/internal/data/repo/repo_tokens.gosimilarity index 94%rename from backend/internal/repo/repo_tokens.gorename to backend/internal/data/repo/repo_tokens.goindex 38c74435..7d9115b3 100644--- a/backend/internal/repo/repo_tokens.go+++ b/backend/internal/data/repo/repo_tokens.go@@ -5,8 +5,8 @@ import ("time""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/authtokens"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/authtokens")type TokenRepository struct {diff --git a/backend/internal/repo/repo_tokens_test.go b/backend/internal/data/repo/repo_tokens_test.gosimilarity index 100%rename from backend/internal/repo/repo_tokens_test.gorename to backend/internal/data/repo/repo_tokens_test.godiff --git a/backend/internal/repo/repo_users.go b/backend/internal/data/repo/repo_users.gosimilarity index 96%rename from backend/internal/repo/repo_users.gorename to backend/internal/data/repo/repo_users.goindex 828c4c2f..0eaa1275 100644--- a/backend/internal/repo/repo_users.go+++ b/backend/internal/data/repo/repo_users.go@@ -4,8 +4,8 @@ import ("context""github.com/google/uuid"- "github.com/hay-kot/homebox/backend/ent"- "github.com/hay-kot/homebox/backend/ent/user"+ "github.com/hay-kot/homebox/backend/internal/data/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent/user")type UserRepository struct {diff --git a/backend/internal/repo/repo_users_test.go b/backend/internal/data/repo/repo_users_test.gosimilarity index 100%rename from backend/internal/repo/repo_users_test.gorename to backend/internal/data/repo/repo_users_test.godiff --git a/backend/internal/repo/repos_all.go b/backend/internal/data/repo/repos_all.gosimilarity index 92%rename from backend/internal/repo/repos_all.gorename to backend/internal/data/repo/repos_all.goindex d01b402f..e726e88a 100644--- a/backend/internal/repo/repos_all.go+++ b/backend/internal/data/repo/repos_all.go@@ -1,6 +1,6 @@package repo-import "github.com/hay-kot/homebox/backend/ent"+import "github.com/hay-kot/homebox/backend/internal/data/ent"// AllRepos is a container for all the repository interfacestype AllRepos struct {diff --git a/backend/internal/mocks/chimocker/chimocker.go b/backend/internal/mocks/chimocker/chimocker.godeleted file mode 100644index b9184037..00000000--- a/backend/internal/mocks/chimocker/chimocker.go+++ /dev/null@@ -1,30 +0,0 @@-package chimocker--import (- "context"- "net/http"-- "github.com/go-chi/chi/v5"-)--type Params map[string]string--// WithUrlParam returns a pointer to a request object with the given URL params-// added to a new chi.Context object.-func WithUrlParam(r *http.Request, key, value string) *http.Request {- chiCtx := chi.NewRouteContext()- req := r.WithContext(context.WithValue(r.Context(), chi.RouteCtxKey, chiCtx))- chiCtx.URLParams.Add(key, value)- return req-}--// WithUrlParams returns a pointer to a request object with the given URL params-// added to a new chi.Context object. for single param assignment see WithUrlParam-func WithUrlParams(r *http.Request, params Params) *http.Request {- chiCtx := chi.NewRouteContext()- req := r.WithContext(context.WithValue(r.Context(), chi.RouteCtxKey, chiCtx))- for key, value := range params {- chiCtx.URLParams.Add(key, value)- }- return req-}diff --git a/backend/internal/mocks/factories/users.go b/backend/internal/mocks/factories/users.godeleted file mode 100644index 6f618fbb..00000000--- a/backend/internal/mocks/factories/users.go+++ /dev/null@@ -1,16 +0,0 @@-package factories--import (- "github.com/hay-kot/homebox/backend/internal/repo"- "github.com/hay-kot/homebox/backend/pkgs/faker"-)--func UserFactory() repo.UserCreate {- f := faker.NewFaker()- return repo.UserCreate{- Name: f.Str(10),- Email: f.Email(),- Password: f.Str(10),- IsSuperuser: f.Bool(),- }-}diff --git a/backend/internal/services/all.go b/backend/internal/services/all.godeleted file mode 100644index 20e377f5..00000000--- a/backend/internal/services/all.go+++ /dev/null@@ -1,28 +0,0 @@-package services--import "github.com/hay-kot/homebox/backend/internal/repo"--type AllServices struct {- User *UserService- Group *GroupService- Location *LocationService- Labels *LabelService- Items *ItemService-}--func New(repos *repo.AllRepos) *AllServices {- if repos == nil {- panic("repos cannot be nil")- }-- return &AllServices{- User: &UserService{repos},- Group: &GroupService{repos},- Location: &LocationService{repos},- Labels: &LabelService{repos},- Items: &ItemService{- repo: repos,- at: attachmentTokens{},- },- }-}diff --git a/backend/internal/services/service_labels.go b/backend/internal/services/service_labels.godeleted file mode 100644index 34d67dfb..00000000--- a/backend/internal/services/service_labels.go+++ /dev/null@@ -1,37 +0,0 @@-package services--import (- "context"-- "github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"-)--type LabelService struct {- repos *repo.AllRepos-}--func (svc *LabelService) Create(ctx context.Context, groupId uuid.UUID, data repo.LabelCreate) (repo.LabelOut, error) {- return svc.repos.Labels.Create(ctx, groupId, data)-}--func (svc *LabelService) Update(ctx context.Context, groupId uuid.UUID, data repo.LabelUpdate) (repo.LabelOut, error) {- return svc.repos.Labels.Update(ctx, data)-}--func (svc *LabelService) Delete(ctx context.Context, gid uuid.UUID, id uuid.UUID) error {- _, err := svc.repos.Labels.GetOneByGroup(ctx, gid, id)- if err != nil {- return err- }- return svc.repos.Labels.Delete(ctx, id)-}--func (svc *LabelService) Get(ctx context.Context, gid uuid.UUID, id uuid.UUID) (repo.LabelOut, error) {- return svc.repos.Labels.GetOneByGroup(ctx, gid, id)--}--func (svc *LabelService) GetAll(ctx context.Context, groupId uuid.UUID) ([]repo.LabelSummary, error) {- return svc.repos.Labels.GetAll(ctx, groupId)-}diff --git a/backend/internal/services/service_locations.go b/backend/internal/services/service_locations.godeleted file mode 100644index 71523377..00000000--- a/backend/internal/services/service_locations.go+++ /dev/null@@ -1,47 +0,0 @@-package services--import (- "context"- "errors"-- "github.com/google/uuid"- "github.com/hay-kot/homebox/backend/internal/repo"-)--var (- ErrNotOwner = errors.New("not owner")-)--type LocationService struct {- repos *repo.AllRepos-}--func (svc *LocationService) GetOne(ctx context.Context, groupId uuid.UUID, id uuid.UUID) (repo.LocationOut, error) {- return svc.repos.Locations.GetOneByGroup(ctx, groupId, id)-}--func (svc *LocationService) GetAll(ctx context.Context, groupId uuid.UUID) ([]repo.LocationOutCount, error) {- return svc.repos.Locations.GetAll(ctx, groupId)-}--func (svc *LocationService) Create(ctx context.Context, groupId uuid.UUID, data repo.LocationCreate) (repo.LocationOut, error) {- return svc.repos.Locations.Create(ctx, groupId, data)-}--func (svc *LocationService) Delete(ctx context.Context, groupId uuid.UUID, id uuid.UUID) error {- _, err := svc.repos.Locations.GetOneByGroup(ctx, groupId, id)- if err != nil {- return err- }- return svc.repos.Locations.Delete(ctx, id)-}--func (svc *LocationService) Update(ctx context.Context, groupId uuid.UUID, data repo.LocationUpdate) (repo.LocationOut, error) {- location, err := svc.repos.Locations.GetOneByGroup(ctx, groupId, data.ID)- if err != nil {- return repo.LocationOut{}, err- }-- data.ID = location.ID- return svc.repos.Locations.Update(ctx, data)-}diff --git a/backend/internal/config/conf.go b/backend/internal/sys/config/conf.gosimilarity index 100%rename from backend/internal/config/conf.gorename to backend/internal/sys/config/conf.godiff --git a/backend/internal/config/conf_database.go b/backend/internal/sys/config/conf_database.gosimilarity index 100%rename from backend/internal/config/conf_database.gorename to backend/internal/sys/config/conf_database.godiff --git a/backend/internal/config/conf_logger.go b/backend/internal/sys/config/conf_logger.gosimilarity index 100%rename from backend/internal/config/conf_logger.gorename to backend/internal/sys/config/conf_logger.godiff --git a/backend/internal/config/conf_mailer.go b/backend/internal/sys/config/conf_mailer.gosimilarity index 100%rename from backend/internal/config/conf_mailer.gorename to backend/internal/sys/config/conf_mailer.godiff --git a/backend/internal/config/conf_mailer_test.go b/backend/internal/sys/config/conf_mailer_test.gosimilarity index 100%rename from backend/internal/config/conf_mailer_test.gorename to backend/internal/sys/config/conf_mailer_test.godiff --git a/backend/internal/sys/validate/validate.go b/backend/internal/sys/validate/validate.gonew file mode 100644index 00000000..ed22c0f5--- /dev/null+++ b/backend/internal/sys/validate/validate.go@@ -0,0 +1,37 @@+package validate++import "github.com/go-playground/validator/v10"++var validate *validator.Validate++func init() {+ validate = validator.New()+}++// Checks a struct for validation errors and returns any errors the occur. This+// wraps the validate.Struct() function and provides some error wrapping. When+// a validator.ValidationErrors is returned, it is wrapped transformed into a+// FieldErrors array and returned.+func Check(val any) error {+ err := validate.Struct(val)++ if err != nil {+ verrors, ok := err.(validator.ValidationErrors)+ if !ok {+ return err+ }++ fields := make(FieldErrors, 0, len(verrors))+ for _, verr := range verrors {+ field := FieldError{+ Field: verr.Field(),+ Error: verr.Error(),+ }++ fields = append(fields, field)+ }+ return fields+ }++ return nil+}diff --git a/backend/internal/web/mid/errors.go b/backend/internal/web/mid/errors.goindex 0802a11f..7aa659c0 100644--- a/backend/internal/web/mid/errors.go+++ b/backend/internal/web/mid/errors.go@@ -3,7 +3,7 @@ package midimport ("net/http"- "github.com/hay-kot/homebox/backend/ent"+ "github.com/hay-kot/homebox/backend/internal/data/ent""github.com/hay-kot/homebox/backend/internal/sys/validate""github.com/hay-kot/homebox/backend/pkgs/server""github.com/rs/zerolog"diff --git a/backend/static/favicon.ico b/backend/static/favicon.icodeleted file mode 100644index c6f7f740..00000000Binary files a/backend/static/favicon.ico and /dev/null differ