Merged in feature/demo (pull request #116)

Demo prep + Fix client sync

* firstversion

* clientsync

* configlint

* fixtests
This commit is contained in:
Michael McGuinness
2025-04-22 19:57:35 +00:00
parent fee71e7740
commit 47fec079e5
21 changed files with 642 additions and 41 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"net/http"
"queryorchestration/internal/client"
clientupdate "queryorchestration/internal/client/update"
"github.com/labstack/echo/v4"
)
@@ -47,7 +48,7 @@ func (s *Controllers) UpdateClient(ctx echo.Context, id ClientID) error {
return echo.NewHTTPError(http.StatusBadRequest, err)
}
err := s.svc.Client.Update(ctx.Request().Context(), id, &client.Update{
err := s.svc.ClientUpdate.Update(ctx.Request().Context(), id, &clientupdate.Update{
Name: req.Name,
CanSync: req.CanSync,
})
+11 -2
View File
@@ -10,8 +10,10 @@ import (
queryapi "queryorchestration/api/queryAPI"
"queryorchestration/internal/client"
clientupdate "queryorchestration/internal/client/update"
"queryorchestration/internal/database/repository"
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/serviceconfig/queue/clientsync"
"github.com/labstack/echo/v4"
"github.com/pashagolub/pgxmock/v3"
@@ -19,6 +21,11 @@ import (
"github.com/stretchr/testify/require"
)
type ClientConfig struct {
serviceconfig.BaseConfig
clientsync.ConfigProvider
}
func TestCreateClient(t *testing.T) {
pool, err := pgxmock.NewPool()
require.NoError(t, err)
@@ -97,12 +104,14 @@ func TestUpdateClient(t *testing.T) {
pool, err := pgxmock.NewPool()
require.NoError(t, err)
cfg := &serviceconfig.BaseConfig{}
cfg := &ClientConfig{}
cfg.DBPool = pool
cfg.DBQueries = repository.New(pool)
cons := queryapi.NewControllers(&queryapi.Services{
Client: client.New(cfg),
ClientUpdate: clientupdate.New(cfg, &clientupdate.Services{
Client: client.New(cfg),
}),
})
cs := false
+2
View File
@@ -2,6 +2,7 @@ package queryapi
import (
"queryorchestration/internal/client"
clientupdate "queryorchestration/internal/client/update"
"queryorchestration/internal/collector"
collectorset "queryorchestration/internal/collector/set"
"queryorchestration/internal/document"
@@ -21,6 +22,7 @@ type Services struct {
QueryUpdate *queryupdate.Service
QueryTest *querytest.Service
Client *client.Service
ClientUpdate *clientupdate.Service
Document *document.Service
}