Merged in feature/textExtractionsPart1 (pull request #192)

all schema and rest apis for text extraction support

* in progress

* stage 8 complete

* phase 9 completed

* phase 9 complete

* ongoing - s3 path fix

* working

* optimize ci build

* e2e tests

* missing test
This commit is contained in:
Jay Brown
2025-11-26 19:23:42 +00:00
parent 2b43799f56
commit c45e1dd427
67 changed files with 16120 additions and 817 deletions
+16 -8
View File
@@ -9,6 +9,8 @@ import (
"queryorchestration/internal/database/repository"
documentinit "queryorchestration/internal/document/init"
"queryorchestration/internal/serviceconfig/objectstore"
"github.com/google/uuid"
)
const Name = "docInitRunner"
@@ -41,8 +43,9 @@ func (s Runner) Process(ctx context.Context, body Body) bool {
return false
}
// Get filename from documentUploads table
// Get filename and folder_id from documentUploads table
var filename *string
var folderID *uuid.UUID
upload, err := s.svc.Queries.GetDocumentUploadByKey(ctx, &repository.GetDocumentUploadByKeyParams{
Bucket: body.Bucket,
Key: body.Key,
@@ -51,20 +54,25 @@ func (s Runner) Process(ctx context.Context, body Body) bool {
slog.Error("unable to get document upload", "bucket", body.Bucket, "key", body.Key, "error", err)
return false
}
if err == nil && upload.Filename != nil {
filename = upload.Filename
if err == nil {
if upload.Filename != nil {
filename = upload.Filename
}
folderID = upload.FolderID
}
id, err := s.svc.Document.Create(ctx, &documentinit.Create{
Key: key,
Bucket: body.Bucket,
Hash: body.Hash,
Filename: filename,
Key: key,
Bucket: body.Bucket,
Hash: body.Hash,
Filename: filename,
OriginalPath: filename, // For batch uploads, filename contains the full original path
FolderID: folderID,
})
if err != nil {
return false
}
slog.Debug("created document", "id", id, "filename", filename)
slog.Debug("created document", "id", id, "filename", filename, "folder_id", folderID)
return true
}