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

@@ -13,7 +13,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"
)
@@ -89,7 +89,7 @@ func (s *Service) postCreditResponder(_ context.Context, req *ledgerv1.PostCredi
return nil, err
}
accountsByRef := map[primitive.ObjectID]*pmodel.LedgerAccount{accountRef: account}
accountsByRef := map[bson.ObjectID]*pmodel.LedgerAccount{accountRef: account}
eventTime := getEventTime(req.EventTime)
creditAmount, _ := parseDecimal(req.Money.Amount)
@@ -109,7 +109,7 @@ func (s *Service) postCreditResponder(_ context.Context, req *ledgerv1.PostCredi
postingLines := make([]*model.PostingLine, 0, 2+len(charges))
mainLine := &model.PostingLine{
JournalEntryRef: primitive.NilObjectID,
JournalEntryRef: bson.NilObjectID,
AccountRef: accountRef,
Amount: creditAmount.String(),
Currency: req.Money.Currency,
@@ -146,7 +146,7 @@ func (s *Service) postCreditResponder(_ context.Context, req *ledgerv1.PostCredi
entryTotal = entryTotal.Add(chargeAmount)
chargeLine := &model.PostingLine{
JournalEntryRef: primitive.NilObjectID,
JournalEntryRef: bson.NilObjectID,
AccountRef: chargeAccountRef,
Amount: chargeAmount.String(),
Currency: charge.Money.Currency,
@@ -170,7 +170,7 @@ func (s *Service) postCreditResponder(_ context.Context, req *ledgerv1.PostCredi
contraAmount := entryTotal.Neg()
if !contraAmount.IsZero() || len(postingLines) == 1 {
contraLine := &model.PostingLine{
JournalEntryRef: primitive.NilObjectID,
JournalEntryRef: bson.NilObjectID,
AccountRef: *contraAccountID,
Amount: contraAmount.String(),
Currency: req.Money.Currency,