improved logging in callbacks

This commit is contained in:
Stephan D
2026-03-03 01:07:35 +01:00
parent b10ec79fe0
commit bae4cd6e35
45 changed files with 226 additions and 146 deletions

View File

@@ -11,7 +11,7 @@ import (
const (
paymentTypeAccount pkgmodel.PaymentType = 8
maxPrivateMethodResolutionDepth = 8
maxPrivateMethodResolutionDepth int = 8
)
func (s *Service) GetPaymentMethodPrivate(ctx context.Context, req *methodsv1.GetPaymentMethodPrivateRequest) (*methodsv1.GetPaymentMethodPrivateResponse, error) {

View File

@@ -8,6 +8,7 @@ import (
np "github.com/tech/sendico/pkg/messaging/notifications/processor"
nm "github.com/tech/sendico/pkg/model/notification"
"github.com/tech/sendico/pkg/mservice"
"github.com/tech/sendico/pkg/mutil/mzap"
"go.mongodb.org/mongo-driver/v2/bson"
"go.uber.org/zap"
)
@@ -62,25 +63,25 @@ func (s *Service) onRecipientNotification(
if err != nil {
s.logger.Warn("Failed to cascade archive payment methods by recipient",
zap.Error(err),
zap.String("recipient_ref", recipientRef.Hex()),
zap.String("actor_account_ref", actorAccountRef.Hex()))
mzap.ObjRef("recipient_ref", recipientRef),
mzap.ObjRef("actor_account_ref", actorAccountRef))
return err
}
s.logger.Info("Recipient archive cascade applied to payment methods",
zap.String("recipient_ref", recipientRef.Hex()),
zap.String("actor_account_ref", actorAccountRef.Hex()),
mzap.ObjRef("recipient_ref", recipientRef),
mzap.ObjRef("actor_account_ref", actorAccountRef),
zap.Int("updated_count", updated))
case nm.NADeleted:
if err := s.pmstore.DeleteByRecipient(ctx, recipientRef); err != nil {
s.logger.Warn("Failed to cascade delete payment methods by recipient",
zap.Error(err),
zap.String("recipient_ref", recipientRef.Hex()),
zap.String("actor_account_ref", actorAccountRef.Hex()))
mzap.ObjRef("recipient_ref", recipientRef),
mzap.ObjRef("actor_account_ref", actorAccountRef))
return err
}
s.logger.Info("Recipient delete cascade applied to payment methods",
zap.String("recipient_ref", recipientRef.Hex()),
zap.String("actor_account_ref", actorAccountRef.Hex()))
mzap.ObjRef("recipient_ref", recipientRef),
mzap.ObjRef("actor_account_ref", actorAccountRef))
}
return nil