fixed doc env vars + mongo v2 migration

This commit is contained in:
Stephan D
2026-01-31 00:26:42 +01:00
parent cbb7bd8ba6
commit 1aa7e287fb
356 changed files with 1705 additions and 1729 deletions

View File

@@ -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,