Merged in feature/clientexternalid (pull request #99)

Client External ID

* normalizeexternalid

* cleanopenapi

* cleanopenapi

* changingpublic

* noprecommit

* testing

* precommit

* processtest

* nodb

* tests

* tests
This commit is contained in:
Michael McGuinness
2025-03-11 16:31:06 +00:00
parent 8e4d66a998
commit 6648cdf1cb
68 changed files with 5171 additions and 1106 deletions
+5 -7
View File
@@ -48,14 +48,12 @@ func TestDocInitRunner(t *testing.T) {
assert.NotNil(t, runner)
t.Run("valid", func(t *testing.T) {
j := client.Client{
ID: uuid.New(),
}
clientId := uuid.New()
bucketName := "bucketName"
location := fmt.Sprintf("%s/aaa", j.ID.String())
location := fmt.Sprintf("%s/aaa", clientId)
docinfo := document.Document{
ID: uuid.New(),
ClientID: j.ID,
ClientID: clientId,
Hash: "example_hash",
}
doc := S3EventNotification{
@@ -81,11 +79,11 @@ func TestDocInitRunner(t *testing.T) {
Body: &body,
}
pool.ExpectQuery("name: GetDocumentIDByHash :one").WithArgs(docinfo.Hash, database.MustToDBUUID(j.ID)).WillReturnRows(
pool.ExpectQuery("name: GetDocumentIDByHash :one").WithArgs(docinfo.Hash, database.MustToDBUUID(clientId)).WillReturnRows(
pgxmock.NewRows([]string{"id"}),
)
pool.ExpectBegin()
pool.ExpectQuery("name: CreateDocument :one").WithArgs(database.MustToDBUUID(j.ID), docinfo.Hash).
pool.ExpectQuery("name: CreateDocument :one").WithArgs(database.MustToDBUUID(clientId), docinfo.Hash).
WillReturnRows(
pgxmock.NewRows([]string{"id"}).
AddRow(database.MustToDBUUID(docinfo.ID)),