Merged in feature/docresult (pull request #105)

Document Result Endpoint

* testing

* cleantesting

* progress

* query

* lint

* readme

* dockerclient

* api

* passtest

* tests

* test
This commit is contained in:
Michael McGuinness
2025-03-17 18:14:15 +00:00
parent f7c41c4ef3
commit 555b6d420b
105 changed files with 3276 additions and 2484 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ func (s *Service) clean(ctx context.Context, id uuid.UUID) error {
slog.Debug("cleaning document", "id", id.String())
docId := database.MustToDBUUID(id)
doc, err := s.cfg.GetDBQueries().GetDocument(ctx, docId)
doc, err := s.cfg.GetDBQueries().GetDocumentSummary(ctx, docId)
if err != nil {
return err
}
+3 -3
View File
@@ -35,7 +35,7 @@ func TestClean(t *testing.T) {
cfg: cfg,
}
doc := document.Document{
doc := document.DocumentSummary{
ID: uuid.New(),
ClientID: uuid.New(),
Hash: "example_hash",
@@ -46,7 +46,7 @@ func TestClean(t *testing.T) {
}
dbid := database.MustToDBUUID(doc.ID)
pool.ExpectQuery("name: GetDocument :one").WithArgs(dbid).
pool.ExpectQuery("name: GetDocumentSummary :one").WithArgs(dbid).
WillReturnRows(
pgxmock.NewRows([]string{"id", "clientId", "hash"}).
AddRow(dbid, database.MustToDBUUID(doc.ClientID), doc.Hash),
@@ -173,7 +173,7 @@ func TestStoreClean(t *testing.T) {
cfg: cfg,
}
doc := document.Document{
doc := document.DocumentSummary{
ID: uuid.New(),
}
inloc := document.Location{
+2 -2
View File
@@ -50,7 +50,7 @@ func TestCreate(t *testing.T) {
cfg: cfg,
}
doc := document.Document{
doc := document.DocumentSummary{
ID: uuid.New(),
ClientID: uuid.New(),
Hash: "example_hash",
@@ -65,7 +65,7 @@ func TestCreate(t *testing.T) {
pgxmock.NewRows([]string{"isclean"}).
AddRow(false),
)
pool.ExpectQuery("name: GetDocument :one").WithArgs(dbid).
pool.ExpectQuery("name: GetDocumentSummary :one").WithArgs(dbid).
WillReturnRows(
pgxmock.NewRows([]string{"id", "clientId", "hash"}).
AddRow(dbid, database.MustToDBUUID(doc.ClientID), doc.Hash),