fixed doc env vars + mongo v2 migration
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
pmodel "github.com/tech/sendico/pkg/model"
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
ledgerv1 "github.com/tech/sendico/pkg/proto/ledger/v1"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -115,7 +115,7 @@ func (s *Service) fxResponder(_ context.Context, req *ledgerv1.FXRequest) gsresp
|
||||
return nil, merrors.InvalidArgument(fmt.Sprintf("to_account: %s", err.Error()))
|
||||
}
|
||||
|
||||
accountsByRef := map[primitive.ObjectID]*pmodel.LedgerAccount{
|
||||
accountsByRef := map[bson.ObjectID]*pmodel.LedgerAccount{
|
||||
fromAccountRef: fromAccount,
|
||||
toAccountRef: toAccount,
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func (s *Service) fxResponder(_ context.Context, req *ledgerv1.FXRequest) gsresp
|
||||
|
||||
// Debit from account
|
||||
fromLine := &model.PostingLine{
|
||||
JournalEntryRef: primitive.NilObjectID,
|
||||
JournalEntryRef: bson.NilObjectID,
|
||||
AccountRef: fromAccountRef,
|
||||
Amount: fromAmount.Neg().String(), // negative = debit
|
||||
Currency: req.FromMoney.Currency,
|
||||
@@ -142,7 +142,7 @@ func (s *Service) fxResponder(_ context.Context, req *ledgerv1.FXRequest) gsresp
|
||||
|
||||
// Credit to account
|
||||
toLine := &model.PostingLine{
|
||||
JournalEntryRef: primitive.NilObjectID,
|
||||
JournalEntryRef: bson.NilObjectID,
|
||||
AccountRef: toAccountRef,
|
||||
Amount: toAmount.String(), // positive = credit
|
||||
Currency: req.ToMoney.Currency,
|
||||
@@ -175,7 +175,7 @@ func (s *Service) fxResponder(_ context.Context, req *ledgerv1.FXRequest) gsresp
|
||||
}
|
||||
|
||||
chargeLine := &model.PostingLine{
|
||||
JournalEntryRef: primitive.NilObjectID,
|
||||
JournalEntryRef: bson.NilObjectID,
|
||||
AccountRef: chargeAccountRef,
|
||||
Amount: chargeAmount.String(),
|
||||
Currency: charge.Money.Currency,
|
||||
|
||||
Reference in New Issue
Block a user