fixed tests and compilation

This commit is contained in:
Stephan D
2026-02-13 02:33:22 +01:00
parent 71a7a474c8
commit 1b3aa0f9ea
8 changed files with 27 additions and 73 deletions

View File

@@ -23,7 +23,7 @@ type quotesStore struct {
txFactory transaction.Factory
}
func NewQuotes(logger mlogger.Logger, db *mongo.Database, txFactory transaction.Factory) (quotestorage.QuotesStore, error) {
func NewQuotes(logger mlogger.Logger, db *mongo.Database, txFactory transaction.Factory) (storage.QuotesStore, error) {
repo := repository.CreateMongoRepository(db, model.QuotesCollection)
indexes := []*ri.Definition{
{

View File

@@ -22,6 +22,7 @@ type repoStub struct {
findOneFn func(ctx context.Context, query builder.Query, result storable.Storable) error
findManyFn func(ctx context.Context, query builder.Query, decoder rd.DecodingFunc) error
updateFn func(ctx context.Context, obj storable.Storable) error
upsertFn func(ctx context.Context, obj storable.Storable) error
patchManyFn func(ctx context.Context, filter builder.Query, patch builder.Patch) (int, error)
createIdxFn func(def *ri.Definition) error
}
@@ -69,6 +70,13 @@ func (r *repoStub) Update(ctx context.Context, obj storable.Storable) error {
return nil
}
func (r *repoStub) Upsert(ctx context.Context, obj storable.Storable) error {
if r.upsertFn != nil {
return r.upsertFn(ctx, obj)
}
return nil
}
func (r *repoStub) Patch(ctx context.Context, id bson.ObjectID, patch builder.Patch) error {
return merrors.NotImplemented("Patch not used")
}