outbox for gateways
This commit is contained in:
@@ -36,7 +36,7 @@ func (s *Service) getBalanceResponder(_ context.Context, req *ledgerv1.GetBalanc
|
||||
if err == storage.ErrAccountNotFound {
|
||||
return nil, merrors.NoData("account not found")
|
||||
}
|
||||
logger.Warn("failed to get account", zap.Error(err))
|
||||
logger.Warn("Failed to get account", zap.Error(err))
|
||||
return nil, merrors.Internal("failed to get account")
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ func (s *Service) getBalanceResponder(_ context.Context, req *ledgerv1.GetBalanc
|
||||
LastUpdated: timestamppb.Now(),
|
||||
}, nil
|
||||
}
|
||||
logger.Warn("failed to get balance", zap.Error(err))
|
||||
logger.Warn("Failed to get balance", zap.Error(err))
|
||||
return nil, merrors.Internal("failed to get balance")
|
||||
}
|
||||
|
||||
@@ -92,14 +92,14 @@ func (s *Service) getJournalEntryResponder(_ context.Context, req *ledgerv1.GetE
|
||||
if err == storage.ErrJournalEntryNotFound {
|
||||
return nil, merrors.NoData("journal entry not found")
|
||||
}
|
||||
logger.Warn("failed to get journal entry", zap.Error(err))
|
||||
logger.Warn("Failed to get journal entry", zap.Error(err))
|
||||
return nil, merrors.Internal("failed to get journal entry")
|
||||
}
|
||||
|
||||
// Get posting lines for this entry
|
||||
lines, err := s.storage.PostingLines().ListByJournalEntry(ctx, entryRef)
|
||||
if err != nil {
|
||||
logger.Warn("failed to get posting lines", zap.Error(err))
|
||||
logger.Warn("Failed to get posting lines", zap.Error(err))
|
||||
return nil, merrors.Internal("failed to get posting lines")
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ func (s *Service) getStatementResponder(_ context.Context, req *ledgerv1.GetStat
|
||||
if err == storage.ErrAccountNotFound {
|
||||
return nil, merrors.NoData("account not found")
|
||||
}
|
||||
logger.Warn("failed to get account", zap.Error(err))
|
||||
logger.Warn("Failed to get account", zap.Error(err))
|
||||
return nil, merrors.Internal("failed to get account")
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ func (s *Service) getStatementResponder(_ context.Context, req *ledgerv1.GetStat
|
||||
// Get posting lines for account
|
||||
postingLines, err := s.storage.PostingLines().ListByAccount(ctx, accountRef, limit+1, offset)
|
||||
if err != nil {
|
||||
logger.Warn("failed to get posting lines", zap.Error(err))
|
||||
logger.Warn("Failed to get posting lines", zap.Error(err))
|
||||
return nil, merrors.Internal("failed to get posting lines")
|
||||
}
|
||||
|
||||
@@ -196,20 +196,20 @@ func (s *Service) getStatementResponder(_ context.Context, req *ledgerv1.GetStat
|
||||
for entryRefHex := range entryMap {
|
||||
entryRef, err := parseObjectID(entryRefHex)
|
||||
if err != nil {
|
||||
s.logger.Warn("invalid journal entry ref in posting lines", zap.String("entry_ref", entryRefHex), zap.Error(err))
|
||||
s.logger.Warn("Invalid journal entry ref in posting lines", zap.String("entry_ref", entryRefHex), zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
entry, err := s.storage.JournalEntries().Get(ctx, entryRef)
|
||||
if err != nil {
|
||||
logger.Warn("failed to get journal entry for statement", zap.Error(err), zap.String("entry_ref", entryRefHex))
|
||||
logger.Warn("Failed to get journal entry for statement", zap.Error(err), zap.String("entry_ref", entryRefHex))
|
||||
continue
|
||||
}
|
||||
|
||||
// Get all lines for this entry
|
||||
lines, err := s.storage.PostingLines().ListByJournalEntry(ctx, entryRef)
|
||||
if err != nil {
|
||||
logger.Warn("failed to get posting lines for entry", zap.Error(err), zap.String("entry_ref", entryRefHex))
|
||||
logger.Warn("Failed to get posting lines for entry", zap.Error(err), zap.String("entry_ref", entryRefHex))
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user