Merge pull request 'tgsettle status optimization, + build optimization' (#404) from tg-403 into main
All checks were successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/gateway_tgsettle Pipeline was successful

Reviewed-on: #404
This commit was merged in pull request #404.
This commit is contained in:
2026-02-04 09:55:08 +00:00
15 changed files with 100 additions and 1 deletions

View File

@@ -9,6 +9,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/server/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -8,6 +8,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/billing/documents/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -8,6 +8,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/billing/fees/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -7,6 +7,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/discovery/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -7,6 +7,13 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/server/**
- api/pkg/**
- api/proto/**
- frontend/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -11,6 +11,13 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/fx/ingestor/**
- api/fx/storage/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -11,6 +11,14 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/fx/oracle/**
- api/fx/storage/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -11,6 +11,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/gateway/chain/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -10,6 +10,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/gateway/mntx/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -8,6 +8,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/gateway/tgsettle/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -11,6 +11,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/gateway/tron/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -8,6 +8,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/ledger/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -11,6 +11,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/notification/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -8,6 +8,12 @@ matrix:
when:
- event: push
branch: main
path:
include:
- api/payments/orchestrator/**
- api/proto/**
- api/pkg/**
ignore_message: '[REBUILD]'
steps:
- name: version

View File

@@ -253,6 +253,10 @@ func (s *Service) onIntent(ctx context.Context, intent *model.PaymentGatewayInte
s.logger.Warn("Payment gateway intent rejected", zap.String("reason", "requested_money is required"), zap.String("idempotency_key", intent.IdempotencyKey))
return merrors.InvalidArgument("requested_money is required", "requested_money")
}
if intent.OperationRef == "" {
s.logger.Warn("Payment gateway intent rejected", zap.String("reason", "operation_ref is required"))
return merrors.InvalidArgument("operation_ref is required", "operation_ref")
}
if s.repo == nil || s.repo.Payments() == nil {
s.logger.Warn("Payment gateway storage unavailable", zap.String("idempotency_key", intent.IdempotencyKey))
return merrors.Internal("payment gateway storage unavailable")
@@ -274,7 +278,9 @@ func (s *Service) onIntent(ctx context.Context, intent *model.PaymentGatewayInte
zap.String("payment_intent_id", confirmReq.PaymentIntentID),
zap.String("quote_ref", confirmReq.QuoteRef),
zap.String("rail", confirmReq.Rail),
zap.String("status", string(existing.Status)))
zap.String("status", string(existing.Status)),
zap.String("operation_ref", confirmReq.OperationRef),
)
return nil
}
@@ -609,6 +615,10 @@ func intentFromSubmitTransfer(req *chainv1.SubmitTransferRequest, defaultRail, d
if paymentRef == "" {
return nil, merrors.InvalidArgument("submit_transfer: payment_ref is required")
}
operationRef := strings.TrimSpace(req.OperationRef)
if operationRef == "" {
return nil, merrors.InvalidArgument("submit_transfer: operation_ref is required")
}
quoteRef := strings.TrimSpace(metadata[metadataQuoteRef])
targetChatID := strings.TrimSpace(metadata[metadataTargetChatID])
outgoingLeg := strings.TrimSpace(metadata[metadataOutgoingLeg])
@@ -626,6 +636,7 @@ func intentFromSubmitTransfer(req *chainv1.SubmitTransferRequest, defaultRail, d
QuoteRef: quoteRef,
RequestedMoney: requestedMoney,
IntentRef: intentRef,
OperationRef: operationRef,
}, nil
}