fixed doc env vars + mongo v2 migration
This commit is contained in:
@@ -11,8 +11,8 @@ import (
|
||||
"github.com/tech/sendico/pkg/merrors"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -45,7 +45,7 @@ func NewBalances(logger mlogger.Logger, db *mongo.Database) (storage.BalancesSto
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (b *balancesStore) Get(ctx context.Context, accountRef primitive.ObjectID) (*model.AccountBalance, error) {
|
||||
func (b *balancesStore) Get(ctx context.Context, accountRef bson.ObjectID) (*model.AccountBalance, error) {
|
||||
if accountRef.IsZero() {
|
||||
b.logger.Warn("attempt to get balance with zero account ID")
|
||||
return nil, merrors.InvalidArgument("balancesStore: zero account ID")
|
||||
@@ -98,7 +98,7 @@ func (b *balancesStore) Upsert(ctx context.Context, balance *model.AccountBalanc
|
||||
return b.repo.Update(ctx, balance)
|
||||
}
|
||||
|
||||
func (b *balancesStore) IncrementBalance(ctx context.Context, accountRef primitive.ObjectID, amount string) error {
|
||||
func (b *balancesStore) IncrementBalance(ctx context.Context, accountRef bson.ObjectID, amount string) error {
|
||||
if accountRef.IsZero() {
|
||||
b.logger.Warn("attempt to increment balance with zero account ID")
|
||||
return merrors.InvalidArgument("balancesStore: zero account ID")
|
||||
|
||||
Reference in New Issue
Block a user