Repository navigation
feat: issuer analytics, document bulk export, Stellar network selector, auto-invest rule engine - #654
Merged
TS-mfon merged 7 commits intoOct 17, 2026
Conversation
Resolves StellarState#473 Resolves StellarState#477 Resolves StellarState#478 Resolves StellarState#479 - Investor accreditation acknowledgement tracking with terms versioning - Funding deadline extension request with admin approval gate - Platform metrics aggregation endpoints for admin dashboard (60s cache) - Investor portfolio summary endpoint with P&L calculation and pagination
…478-479 feat: implement issues 473, 477, 478, 479 (acknowledgement, extensions, metrics, portfolio)
…73-477-478-479 Revert "feat: implement issues 473, 477, 478, 479"
…t engine - StellarState#588: X-Stellar-Network header middleware resolves per-network Horizon URL/contract id/passphrase onto req.stellarNetwork, defaulting to mainnet and 400ing on an invalid value. - StellarState#587: issuer analytics (funding speed, investor-count trend, on-time repayment rate, reputation score) over 30d/90d/all, cached 5 minutes per issuer and invalidated on settlement or an invoice becoming FUNDED. - StellarState#589: invoice_documents table replaces the single-ipfsHash upload with one row per document; bulk export fetches each from the IPFS gateway, zips them with structured naming, and serves a signed, time-limited download URL via an async job (POST to start, GET to poll/download). Restricted to KYC-approved issuer or investors in the invoice. - StellarState#596: auto-invest rules (category/minYield/maxFaceValue/riskTier/ maxPerInvoice/minWalletBalance) are evaluated against every invoice the moment it's published; a match checks the investor's live Horizon balance before investing, and every attempt -- executed, skipped for balance, or failed -- is recorded as an AutoInvestExecution row. Closes StellarState#587, Closes StellarState#588, Closes StellarState#589, Closes StellarState#596.
Resolved merge conflicts by keeping dev branch changes: - src/app.ts, src/config/env.ts, src/index.ts - src/services: investment, invoice, ipfs, settlement - src/lib/ttl-cache.ts: kept Redis-enabled version from dev The PR features (issuer analytics, document export, network selector, auto-invest) are preserved in the codebase alongside dev's latest updates.
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.
Summary
GET /api/v1/issuers/:wallet/analytics) with funding speed, investor-count trend, on-time repayment rate, and reputation score; TTL-cached, range-filtered (30d / 90d / all).X-Stellar-Networkheader to route testnet vs mainnet Horizon calls; configured via env vars.POST /api/v1/invoices/:id/documents/export); fetches documents from IPFS, packages them into a signed-URL ZIP, async job status polling.AutoInvestRulerows against every newly-published invoice; criteria matching (category, yield, face value, risk tier); wallet-balance gate via Horizon; full execution audit trail inAutoInvestExecution.Changes
AutoInvestRule,AutoInvestExecution,InvoiceDocumentAddInvoiceDocuments,AddAutoInvestIssuerAnalyticsService,DocumentExportService,AutoInvestRulesService,AutoInvestRuleEngineService,HorizonAccountBalanceServicecreateNetworkContextMiddleware/api/v1/issuers,/api/v1/invoices(export),/api/v1/auto-investRiskTierandAutoInvestExecutionStatusenumscategoryfield toInvoicemodeldocumentExportconfig blockConflict Resolution
This PR includes resolution of merge conflicts with the dev branch:
Closes #587
Closes #588
Closes #589
Closes #596