fixed doc env vars + mongo v2 migration
This commit is contained in:
@@ -13,8 +13,8 @@ import (
|
||||
pkm "github.com/tech/sendico/pkg/model"
|
||||
"github.com/tech/sendico/pkg/mservice"
|
||||
"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"
|
||||
)
|
||||
|
||||
@@ -114,7 +114,7 @@ func (a *accountsStore) Create(ctx context.Context, account *pkm.LedgerAccount)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *accountsStore) Get(ctx context.Context, accountRef primitive.ObjectID) (*pkm.LedgerAccount, error) {
|
||||
func (a *accountsStore) Get(ctx context.Context, accountRef bson.ObjectID) (*pkm.LedgerAccount, error) {
|
||||
if accountRef.IsZero() {
|
||||
a.logger.Warn("Attempt to get account with zero ID")
|
||||
return nil, merrors.InvalidArgument("accountsStore: zero account ID")
|
||||
@@ -134,7 +134,7 @@ func (a *accountsStore) Get(ctx context.Context, accountRef primitive.ObjectID)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (a *accountsStore) GetByAccountCode(ctx context.Context, orgRef primitive.ObjectID, accountCode, currency string) (*pkm.LedgerAccount, error) {
|
||||
func (a *accountsStore) GetByAccountCode(ctx context.Context, orgRef bson.ObjectID, accountCode, currency string) (*pkm.LedgerAccount, error) {
|
||||
if orgRef.IsZero() {
|
||||
a.logger.Warn("Attempt to get account with zero organization ID")
|
||||
return nil, merrors.InvalidArgument("accountsStore: zero organization ID")
|
||||
@@ -167,7 +167,7 @@ func (a *accountsStore) GetByAccountCode(ctx context.Context, orgRef primitive.O
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (a *accountsStore) GetByRole(ctx context.Context, orgRef primitive.ObjectID, currency string, role pkm.AccountRole) (*pkm.LedgerAccount, error) {
|
||||
func (a *accountsStore) GetByRole(ctx context.Context, orgRef bson.ObjectID, currency string, role pkm.AccountRole) (*pkm.LedgerAccount, error) {
|
||||
if orgRef.IsZero() {
|
||||
a.logger.Warn("Attempt to get account with zero organization ID")
|
||||
return nil, merrors.InvalidArgument("accountsStore: zero organization ID")
|
||||
@@ -240,7 +240,7 @@ func (a *accountsStore) GetSystemAccount(ctx context.Context, purpose pkm.System
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (a *accountsStore) GetDefaultSettlement(ctx context.Context, orgRef primitive.ObjectID, currency string) (*pkm.LedgerAccount, error) {
|
||||
func (a *accountsStore) GetDefaultSettlement(ctx context.Context, orgRef bson.ObjectID, currency string) (*pkm.LedgerAccount, error) {
|
||||
if orgRef.IsZero() {
|
||||
a.logger.Warn("Attempt to get default settlement with zero organization ID")
|
||||
return nil, merrors.InvalidArgument("accountsStore: zero organization ID")
|
||||
@@ -275,7 +275,7 @@ func (a *accountsStore) GetDefaultSettlement(ctx context.Context, orgRef primiti
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (a *accountsStore) ListByOrganization(ctx context.Context, orgRef primitive.ObjectID, filter *storage.AccountsFilter, limit int, offset int) ([]*pkm.LedgerAccount, error) {
|
||||
func (a *accountsStore) ListByOrganization(ctx context.Context, orgRef bson.ObjectID, filter *storage.AccountsFilter, limit int, offset int) ([]*pkm.LedgerAccount, error) {
|
||||
if orgRef.IsZero() {
|
||||
a.logger.Warn("Attempt to list accounts with zero organization reference")
|
||||
return nil, merrors.InvalidArgument("accountsStore: zero organization reference")
|
||||
@@ -316,7 +316,7 @@ func (a *accountsStore) ListByOrganization(ctx context.Context, orgRef primitive
|
||||
return accounts, nil
|
||||
}
|
||||
|
||||
func (a *accountsStore) UpdateStatus(ctx context.Context, accountRef primitive.ObjectID, status pkm.LedgerAccountStatus) error {
|
||||
func (a *accountsStore) UpdateStatus(ctx context.Context, accountRef bson.ObjectID, status pkm.LedgerAccountStatus) error {
|
||||
if accountRef.IsZero() {
|
||||
a.logger.Warn("Attempt to update account status with zero reference")
|
||||
return merrors.InvalidArgument("accountsStore: zero account reference")
|
||||
|
||||
Reference in New Issue
Block a user