Fix/issues 43 44 45 46#159
Merged
Merged
Conversation
Added GET /api/health returning service status and uptime in seconds.
POST /api/settlements now accepts an items array for multi-asset batch settlements, with each item processed independently under a shared batch ID.
…ant limits - CreateSettlementBody now accepts optional items array (amount/asset) for batch - settlementSchema includes optional batchId field - UpdateMerchantSettingsBody adds minSettlementAmount, maxSettlementAmount, dailySettlementLimit
Validates settlement amounts against min/max and daily aggregate limits stored in merchant settings, returning 422 when limits are exceeded.
|
@devpeter999 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: settlement limits, multi-asset batch, fx-engine health & shutdown
Closes #43, Closes #44, Closes #45, Closes #46
Summary
amountagainstminSettlementAmount/maxSettlementAmountand enforcesdailySettlementLimitvia an aggregate query, returning 422 on violationPOST /api/settlementsaccepts an optionalitemsarray for multi-asset batch settlements; each item gets its own record linked by a sharedbatchId; singleamount/assetrequests remain backward-compatibleGET /api/healthto fx-engine returning{ status: 'ok', uptime: number }SIGTERM/SIGINThandler to fx-engine for graceful shutdown viafastify.close()Files changed
services/fx-engine/src/index.ts— health endpoint + graceful shutdownservices/api-gateway/src/index.ts— settlement limit validation, multi-asset batch logic, missing idempotency constants addedshared/validation/schemas.ts—CreateSettlementBodyextended withitems,UpdateMerchantSettingsBodyextended with limit fields,settlementSchemaincludesbatchIdprisma/schema.prisma—batchId String?added toSettlementprisma/migrations/20260625_add_settlement_batch_id/migration.sql— migration forbatchId