Merged in feature/textextract (pull request #108)
Start adding Textract + UUID changes * base * startclient * ts * short * tests
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"log/slog"
|
||||
|
||||
docsyncrunner "queryorchestration/api/docSyncRunner"
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/serviceconfig/queue"
|
||||
|
||||
@@ -17,7 +16,7 @@ import (
|
||||
func (s *Service) Sync(ctx context.Context, id uuid.UUID) error {
|
||||
hasMore := true
|
||||
offset := int32(0)
|
||||
dbid := database.MustToDBUUID(id)
|
||||
dbid := id
|
||||
|
||||
for hasMore {
|
||||
ids, err := s.cfg.GetDBQueries().ListDocumentIDsBatch(ctx, &repository.ListDocumentIDsBatchParams{
|
||||
@@ -37,7 +36,7 @@ func (s *Service) Sync(ctx context.Context, id uuid.UUID) error {
|
||||
err := s.cfg.SendToQueue(ctx, &queue.SendParams{
|
||||
QueueURL: s.cfg.GetDocumentSyncURL(),
|
||||
Body: docsyncrunner.Body{
|
||||
ID: database.MustToUUID(id.ID),
|
||||
ID: *id.ID,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"queryorchestration/internal/database"
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/document"
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
@@ -54,10 +53,10 @@ func TestTrigger(t *testing.T) {
|
||||
|
||||
svc.batchSize = 1
|
||||
total := int64(2)
|
||||
pool.ExpectQuery("name: ListDocumentIDsBatch :many").WithArgs(database.MustToDBUUID(clientId), svc.batchSize, int32(0)).
|
||||
pool.ExpectQuery("name: ListDocumentIDsBatch :many").WithArgs(clientId, svc.batchSize, int32(0)).
|
||||
WillReturnRows(
|
||||
pgxmock.NewRows([]string{"id", "totalCount"}).
|
||||
AddRow(database.MustToDBUUID(docs[0].ID), &total),
|
||||
AddRow(&docs[0].ID, &total),
|
||||
)
|
||||
mockSQS.EXPECT().
|
||||
SendMessage(
|
||||
@@ -68,10 +67,10 @@ func TestTrigger(t *testing.T) {
|
||||
mock.Anything,
|
||||
).
|
||||
Return(&sqs.SendMessageOutput{}, nil)
|
||||
pool.ExpectQuery("name: ListDocumentIDsBatch :many").WithArgs(database.MustToDBUUID(clientId), svc.batchSize, int32(1)).
|
||||
pool.ExpectQuery("name: ListDocumentIDsBatch :many").WithArgs(clientId, svc.batchSize, int32(1)).
|
||||
WillReturnRows(
|
||||
pgxmock.NewRows([]string{"id", "totalCount"}).
|
||||
AddRow(database.MustToDBUUID(docs[1].ID), &total),
|
||||
AddRow(&docs[1].ID, &total),
|
||||
)
|
||||
mockSQS.EXPECT().
|
||||
SendMessage(
|
||||
@@ -104,7 +103,7 @@ func TestTrigger(t *testing.T) {
|
||||
clientId := uuid.New()
|
||||
|
||||
svc.batchSize = 1
|
||||
pool.ExpectQuery("name: ListDocumentIDsBatch :many").WithArgs(database.MustToDBUUID(clientId), svc.batchSize, int32(0)).
|
||||
pool.ExpectQuery("name: ListDocumentIDsBatch :many").WithArgs(clientId, svc.batchSize, int32(0)).
|
||||
WillReturnRows(
|
||||
pgxmock.NewRows([]string{"id", "totalCount"}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user