The API returns {success: true, data: {...}} but code was accessing
progressResult.currentContributionPerTree directly instead of
progressResult.data.currentContributionPerTree.
This caused:
- totalTreeCount to be 0 (undefined → 0)
- networkTotalContribution to be 0
- No mining distributions happening
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add buyEnabled field to TradingConfig in trading-service with migration
- Add API endpoints for get/set buy enabled status in admin controller
- Add buy function switch card in mining-admin-web trading page
- Implement buyEnabledProvider in mining-app with 2-minute cache
- Show "待开启" when buy function is disabled in trading page
- Add real-time asset value refresh in asset page (1-second updates)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed from reading config.remainingDistribution to calculating:
remainingDistribution = distributionPool - totalDistributed
- Ensures data consistency: remaining + distributed = total pool
- Added Math.max(0, ...) to prevent negative values
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Handle missing currentContributionPerTree with default value
- Add null checks for all network progress fields
- Prevent DecimalError when contribution service returns incomplete data
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously used (pool - remaining) / pool which was incorrect.
Now uses actual distributed amount / total pool for accurate percentage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /api/v2/mining/progress endpoint in MiningController
- Update frontend API to call /progress instead of /admin/mining/status
- Kong routes /api/v2/mining/* with strip_path=false, so endpoint must
be under /mining controller path
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update label in Flutter mining records page
- Update table header in admin web mining records list
- Update memo strings in mining-wallet-service
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wrap all database operations in executeSecondDistribution with
UnitOfWork.executeInTransaction
- Pass transaction client to repository save methods
- Use longer transaction timeout (60s) for batch operations
- Move Redis operations outside transaction (non-ACID)
- Add distributeToSystemAndPendingInTx method that accepts tx client
This resolves the "Unable to start a transaction in the given time"
error caused by multiple concurrent transactions competing for
database connections.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update 10% 进入黑洞 to 10% 进入积分股池
- Update 销毁金额 to 进入积分股池 in sell confirmation
- Update 注意 text in sell confirmation
- Change color from red to green for 积分股池 text
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prevent TypeError when config properties are undefined by using
optional chaining and default values in publishMiningConfigUpdated.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add real-time mining progress statistics similar to burn progress:
- Backend: new /admin/mining/status endpoint in mining-service
- Frontend: MiningProgress component with progress bar and stats
- Shows: total distributed, remaining pool, minutes left, per-minute rate
- Auto-refresh every 60 seconds via React Query
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update Android app label in AndroidManifest.xml
- Update iOS CFBundleDisplayName and CFBundleName in Info.plist
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Problem:
- Multiple concurrent transactions updating system_mining_accounts caused row lock contention
- 16+ transactions waiting for tuple/transactionid locks led to timeout errors
- This prevented writeMinuteRecords() from executing, leaving mining_records empty
Solution:
- Modified SystemMiningAccountRepository.mine() to accept optional external transaction client
- Created new distributeToSystemAndPending() method that processes all system accounts
and pending contributions in a single transaction
- Pre-calculate all rewards before transaction, then execute updates sequentially
- Aggregate all pending contribution rewards into single HEADQUARTERS update
- Move Redis accumulation outside transaction to avoid blocking
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wrap indicator selector Row in SingleChildScrollView for horizontal scrolling
- Add maxX boundary checks in _drawLegend to stop drawing when exceeding available space
- Prevents text overflow on narrow screens or when displaying many indicators
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Refactor to pixel-based scrolling system for smoother interaction
- Fix pinch-to-zoom to properly scale around focal point
- Adjust fullscreen layout to give more space to main chart (65%)
- Add candleWidth parameter to all painters for consistent rendering
- Detect multi-touch gestures using pointerCount
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The GetTeamTreeQuery was importing SYNCED_DATA_REPOSITORY as a Symbol from
the domain interface, but InfrastructureModule defined its own string token.
This caused NestJS dependency resolution to fail.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The dashboard was incorrectly calculating distributed shares using
distributionPool - remainingDistribution. The correct value is the sum
of all users' totalMined balances. Updated mining-service to return
totalDistributed directly, and mining-admin-service to use it.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The mining-admin-service was only listening for SystemContributionUpdated
events, but contribution-service publishes SystemAccountSynced events.
Added the missing handler to properly sync system account contribution data.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add TradingRecordsPage to display trade order history with status
- Connect trading records to profile page "交易记录" button
- Remove unused "提现记录" button from profile page
- Add route and navigation for trading records
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add team info and direct referrals endpoints to contribution-service,
using SyncedReferral data synced via CDC. Update mining-app to use the
new v2 contribution API instead of legacy referral-service.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Link the "我的团队" menu item in profile page to the team tree page,
completing the integration of the team tree feature.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The dashboard was incorrectly using 5 billion as the distribution pool
default when calculating already distributed shares. The actual mining
distribution pool is 2 million shares, not 100 billion.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add KlineChartWidget with pinch-to-zoom, fullscreen mode
- Implement MA, EMA, BOLL indicators for main chart
- Implement MACD, KDJ, RSI indicators for sub chart
- Add volume display with crossline info
- Add C2C trading feature with market/publish/detail pages
- Add P2P transfer functionality (send/receive shares)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The trading-service wraps all responses with { success, data, timestamp }.
Need to extract data.data for burn records endpoint.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add event publishing to enable mining-admin-service to sync data via
Debezium CDC instead of direct API calls:
- MiningConfigUpdated: Published every minute with distribution status
- DailyMiningStatCreated: Published when daily stats are generated
- MiningAccountUpdated: Method added for future per-account sync
These events will be captured by Debezium monitoring the outbox_events
table and forwarded to mining-admin-service via Kafka.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Dashboard now fetches totalDistributed and totalBurned directly from
mining-service and trading-service APIs instead of relying solely on
CDC sync which may not have data.
- Add fetchRemoteServiceData() to get real-time data
- Use mining-service /admin/status for totalDistributed
- Use trading-service /asset/market for totalBurned and circulationPool
- Add 30-second cache to reduce API calls
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>