Commit Graph

134 Commits

Author SHA1 Message Date
hailin 3eeef11197 fix(mobile): filter out revoked authorizations in profile display
Previously, revoked authorizations were still shown in the profile page
because UserAuthorizationSummary.fromList() did not filter by status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 04:35:30 -08:00
hailin 26427443fe feat(mobile): add auth-province and auth-city company display in profile page
- Add authProvinceCompany and authCityCompany to RoleType enum
- Update UserAuthorizationSummary to support all role types
- Update profile page to display all authorization types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:20:25 -08:00
hailin 033268deb9 feat(mobile): improve UX with QR scanning and Huawei compatibility fixes
- Disable Impeller rendering engine to fix video playback on Huawei devices
- Update splash screen text from "榴莲女皇" to "榴莲皇后" and use app logo
- Make referral code input scan-only (disable manual input) on guide page 5
- Add "import mnemonic" entry on guide page 5 for account recovery
- Replace paste button with QR scanner in USDT withdraw address input
- Add camera and gallery QR scanning support for wallet addresses

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 05:39:58 -08:00
hailin 62b6714760 chore(mobile): add splash video asset
Add splash.mp4 video file for the splash screen

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 04:27:51 -08:00
hailin 7bf88cd6a8 feat(mobile): replace splash screen with video player
- Add video_player dependency for video playback
- Create assets/videos directory for splash video
- Implement video splash screen with:
  - Full-screen video playback (splash.mp4)
  - Skip button appears after 1 second
  - Fallback to logo view if video fails to load
  - Auto-navigate when video completes
- Video file should be placed at: assets/videos/splash.mp4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 04:23:04 -08:00
hailin 3644c04521 fix(mobile): auto-show confirm dialog when planting location is saved
When user has previously saved province/city selection:
- Automatically show confirm dialog on page load
- Skip the 5-second countdown timer
- Hide countdown text in dialog when skipCountdown is true
- User can directly confirm and proceed with planting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 04:08:57 -08:00
hailin ca5e903724 feat(mobile): add USDT withdraw feature with Google Authenticator verification
1. Trading page:
   - Add withdraw/transfer button below DST balance section
   - Display USDT balance from wallet-service
   - Navigate to withdraw page on button tap

2. Withdraw USDT page (new):
   - Network selection (KAVA / BSC)
   - Wallet address input with paste support
   - Amount input with max button
   - Fee calculation (0.1%) and actual amount preview
   - Input validation and notice section

3. Withdraw confirm page (new):
   - Transaction details summary
   - Google Authenticator 6-digit code verification
   - Success dialog with navigation back to trading

4. Routes:
   - Add /withdraw/usdt and /withdraw/confirm routes
   - Configure route parameters for WithdrawUsdtParams

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 03:47:22 -08:00
hailin 7320900289 fix(mobile): sync trading page settleable data with profile page
Trading page now fetches settleableUsdt from reward-service instead
of wallet-service to ensure data consistency with profile page.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 03:28:02 -08:00
hailin d1a7c44f23 fix(referral): correct response parsing for authorization-service API
The authorization-service uses TransformInterceptor which wraps all API
responses in a standard format: { success, data, timestamp }

Before this fix, the AuthorizationServiceClient was reading:
  response.data.accountSequence (undefined)

After this fix, it correctly reads:
  response.data.data.accountSequence

This ensures that nearestCommunity, nearestProvinceAuth, and nearestCityAuth
are properly extracted from the wrapped response, allowing community benefits
to be correctly allocated to authorized users instead of falling back to
SYSTEM_HEADQUARTERS_COMMUNITY.

Changes:
- Added AuthorizationServiceResponse<T> interface to model wrapped response
- Updated findNearestCommunity() to use wrapped response type
- Updated findNearestProvince() to use wrapped response type
- Updated findNearestCity() to use wrapped response type
- Updated catchError handlers to return properly structured fallback data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 03:08:50 -08:00
hailin 7d9837fc22 refactor(reward): 前端直接从 reward-service 查询奖励数据
移除 reward-service 和 wallet-service 之间的 Kafka 同步机制:
- 屏蔽 reward-service 的 outbox 发布逻辑
- 屏蔽 wallet-service 的 RewardEventConsumerController 订阅

Flutter 前端改为直接调用 reward-service API:
- 新增 RewardService 调用 /rewards/summary
- profile_page 改用 rewardService.getMyRewardSummary()

这样简化了架构,数据从源头获取,避免同步问题。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 00:36:53 -08:00
hailin 05040b3495 feat(mobile): integrate community hierarchy API in profile page
- Call getMyCommunityHierarchy() to get parent/child community info
- Display parent community name (defaults to 总部社区 if none)
- Display child communities count and first name

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 20:13:52 -08:00
hailin 9cf8b5305b feat(authorization): add community hierarchy API
- Add internal referral-chain API in referral-service for getting ancestor path and team members
- Extend ReferralServiceClient to call referral-chain API
- Add findActiveCommunityByAccountSequences repository method
- Add getCommunityHierarchy application service method
- Add GET /authorizations/my/community-hierarchy endpoint
- Update frontend with CommunityHierarchy model and getMyCommunityHierarchy method

API returns:
- myCommunity: user's own community authorization (if any)
- parentCommunity: nearest parent community (defaults to 总部社区 if none)
- childCommunities: nearest child communities in user's team

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 18:18:49 -08:00
hailin c1d30b0a65 fix(mobile): correct community benefit description
Changed from "有资格获得 3% 的社区福利" to "每新增认种 1 棵可获得 80 USDT"
which accurately reflects the actual community benefit rule.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 17:49:19 -08:00
hailin eae6293b4a fix(mobile): fix authorization API response parsing
The API returns {"success": true, "data": [...]} format but the code
was checking if response.data is List directly. Now properly extracts
the data field before parsing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 17:40:04 -08:00
hailin 034fb53674 refactor: use accountSequence as unified user identifier across all services
- planting-service: extract accountSequence from JWT, pass to referral-service
- referral-service: query by accountSequence instead of userId
- reward-service: add accountSequence field to schema and all layers
- wallet-service: prioritize accountSequence lookup over userId
- authorization-service: change userId from String to BigInt, add accountSequence

This change ensures consistent cross-service user identification using
accountSequence (8-digit unique business ID) instead of internal database IDs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 13:55:03 -08:00
hailin 176a4b1493 fix(guide): change referral code input text color to black for visibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 10:44:39 -08:00
hailin 1b2211d641 feat(mobile): add personal planting count to profile page
Added "个人种植数" stat between direct referral count and team planting
count in the profile page team stats section.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 09:13:20 -08:00
hailin 317ea1234d fix(mobile): use wallet-service for balance queries
- Planting page: fetch USDT balance from wallet-service instead of blockchain-service
- Deposit page: fetch USDT balance from wallet-service instead of blockchain-service

This ensures balance reflects internal wallet state, not on-chain balance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 09:07:15 -08:00
hailin d84fc9409b fix(mobile): add 5s delay before confirm-province-city API call
Backend requires 5 seconds wait time after selectProvinceCity before
confirmProvinceCity can be called. Added delay to comply with this rule.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:30:52 -08:00
hailin c887cf7ec6 fix(mobile): send all 4 fields for province/city selection API
API requires provinceCode, provinceName, cityCode, cityName (all strings).
Previous fix only sent 2 fields, now sending all 4 required fields.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:27:15 -08:00
hailin a44f6c7c35 fix(mobile): send provinceName/cityName instead of codes to API
API expects provinceName and cityName (strings) but frontend was
sending provinceCode and cityCode (numbers), causing 400 error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:23:03 -08:00
hailin 4074281088 feat(mobile): allow manual input for planting quantity
- Replace static text with editable TextField for quantity
- Add warning when input exceeds max quantity based on balance
- Sync +/- buttons with input field value

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:16:23 -08:00
hailin 3dcf685715 feat(mobile): add close button to planting confirm dialog
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:07:27 -08:00
hailin 0b3ddd51bd feat(mobile): connect trading and mining pages to real APIs
- Trading page: fetch settleableUsdt and dstBalance from wallet-service
- Trading page: implement real settlement API call
- Mining page: fetch community/province/city from authorization-service
- Add loading states and error handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 08:02:43 -08:00
hailin 76377c3bb6 fix(mobile): fix wallet API response parsing
The wallet API returns wrapped format { success, data, timestamp }
but the parser was reading from the root object directly.
Now correctly unpacks the inner 'data' field before parsing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 06:55:30 -08:00
hailin 22c32031af feat(authorization): add community assessment progress to profile page
Backend:
- Add initialTargetTreeCount, currentTreeCount, monthlyTargetTreeCount
  fields to AuthorizationDTO and AuthorizationResponse
- Query TeamStatistics to populate current tree count in getUserAuthorizations

Frontend:
- Update AuthorizationResponse to parse new progress fields
- Replace hardcoded community assessment values with real API data
- Show authorization status: red (unauthorized), orange (pending), green (active)
- Display progress bar and target requirements based on benefit status

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 06:44:13 -08:00
hailin 68182fd0a3 feat(referral): add personal/team planting counts to direct referral list
- Backend: batch query TeamStatistics to get each direct referral's
  personalPlantingCount and teamPlantingCount
- Updated DTO and query interfaces with new fields
- Frontend: parse and display "个人/团队" counts in profile page

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 05:57:46 -08:00
hailin e1017fff46 fix(mobile): reduce direct referral list item spacing
- Row gap: 8px → 4px
- Vertical padding: 12px → 8px

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 05:18:23 -08:00
hailin 13f670e9dd fix(referral): fix direct referral list display and count issues
1. Return accountSequence instead of userId for direct referral list display
2. Create missing team statistics record when referrer doesn't have one

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 04:58:16 -08:00
hailin b508d9b201 fix(mobile): change update check interval to 90-300s random
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 04:17:06 -08:00
hailin d6eda59d63 fix(mobile): change update check interval from 24h to 30-90s random
Allows faster detection of urgent updates while preventing excessive
API calls with random cooldown period.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 04:16:03 -08:00
hailin 88c59e92fd fix(mobile): use external storage for APK download and close app on install
- Change download path from getApplicationDocumentsDirectory to
  getExternalStorageDirectory for proper FileProvider support
- Add finishAffinity() after starting APK install intent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 04:03:01 -08:00
hailin fea90b7616 fix(android): add app_flutter path for FileProvider
APK downloaded to getApplicationDocumentsDirectory() which maps to
files/app_flutter/ on Android. FileProvider needs this path configured
to grant URI permission for APK installation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 03:28:13 -08:00
hailin 908f50ab11 fix(mobile): move update check to HomeShellPage with valid context
- Move checkForAppUpdate from SplashPage to HomeShellPage
- Use WidgetsBindingObserver to check on app resume
- Add 24-hour interval check to avoid frequent API calls
- Fix: context.go() invalidates context, so check was never executed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 03:05:19 -08:00
hailin ba3103a7be fix(mobile): add missing orderNo parameter in router
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 22:34:28 -08:00
hailin dfa21c0280 feat(mobile): integrate PlantingService with real API
- Add PlantingService for planting order management
  - createOrder: Create new planting order
  - selectProvinceCity: Select province and city
  - confirmProvinceCity: Confirm province/city selection
  - payOrder: Pay for order
  - getOrder/getMyOrders: Query orders
  - cancelOrder: Cancel unpaid orders
- Register PlantingService in DI container
- Update planting_quantity_page to create order before navigation
- Update planting_location_page to call real API endpoints
- Fix referral-service event-ack.publisher to use KafkaService

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 22:28:36 -08:00
hailin 8335187436 feat(mobile): integrate wallet-service API for profile page rewards
- Add WalletService to fetch wallet/rewards data from backend
- Replace hardcoded earnings data with real API calls
- Add loading/error states for earnings section
- Implement claim rewards functionality with API
- Add comprehensive debug logging for troubleshooting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 20:05:14 -08:00
hailin 62270ed202 update: guide page images for better display on various screen ratios 2025-12-09 19:32:46 -08:00
hailin 526f90d33e fix(mining): handle avatar URL vs SVG in mining page 2025-12-09 18:56:58 -08:00
hailin 91e54946ba fix(mobile): avatar URL handling + API paths + guide page layout
1. Avatar display:
   - Detect if _avatarSvg is URL or SVG string
   - Use Image.network for URLs, SvgPicture.string for SVG

2. API endpoints:
   - Remove /api/v1 prefix from endpoints (already in baseUrl)
   - Fixes duplicate /api/v1/api/v1 in requests

3. Guide page:
   - Restore BoxFit.cover for fullscreen images
   - Fix page indicator positioning with SafeArea

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 18:50:34 -08:00
hailin 243105f97f fix(guide): use fitWidth to prevent image stretching + add debug logs
- Change BoxFit.cover to BoxFit.fitWidth for guide page images
- Add screen info logging (resolution, pixel ratio, aspect ratio)
- Add detailed avatar loading logs in frontend and backend
- Log avatarUrl from DB and API response during recovery

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 18:36:43 -08:00
hailin a3c0d3948d debug: add detailed logging for avatar loading
Added debug logs in:
- ProfilePage._loadUserData() - local storage data
- ProfilePage._loadMeData() - API response and sync conditions
- ProfilePage._buildAvatarContent() - avatar rendering decision
- UserApplicationService.getMe() - backend avatarUrl value

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 18:24:13 -08:00
hailin 8d94d9e4bb fix(mobile): sync avatar from API when local storage is empty
When recovering an account via mnemonic, the avatar SVG might not be
saved to local storage. Now the profile page checks if avatarUrl is
returned from the /me API and updates both the display and local storage.

- Add updateLocalAvatarSvg() method to AccountService
- Update _loadMeData() to sync avatar from API response

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 18:19:13 -08:00
hailin 9dd4bb3ac5 fix(mobile): update guide_5 to jpg and add AnimatedSize for smooth transition
- 将 guide_5.png 改为 guide_5.jpg
- 使用 AnimatedSize 包裹推荐码输入框,切换选项时平滑过渡,消除跳跃闪烁

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 17:49:07 -08:00
hailin 07448b381b feat(mobile): redesign guide pages with fullscreen background images
向导页重新设计:

1. 页面1-4 改为全屏背景图片布局
   - 移除 SafeArea,图片延伸到状态栏
   - 移除文字标题和副标题(文字设计在图片中)
   - 仅保留底部页面指示器(白色圆点)

2. 页面5(欢迎加入页)也改为全屏背景图片
   - 添加渐变遮罩(30%~60%黑色)提高可读性
   - 表单区域改为透明背景
   - 所有文字、输入框、单选按钮改为白色系
   - 退出按钮文字从"退出 Exit"改为"退出"

3. 添加5张向导页背景图片
   - guide_1.jpg ~ guide_4.jpg: 介绍页背景
   - guide_5.png: 欢迎加入页背景

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 17:44:38 -08:00
hailin 53320df220 fix(mobile): always check for updates and add debug logs
- Remove condition that only checked updates when wallet was created
- Add debug logging to version checker and self hosted updater
- Updates should now prompt on every app launch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 07:52:00 -08:00
hailin 58a359d9b3 fix: changelog default value and referrals map syntax
- admin-service: provide default empty string for optional changelog
- profile page: fix map literal syntax for referrals list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 07:00:02 -08:00
hailin 586dfda8f7 fix(admin): support 4-segment version in domain layer & make changelog optional
- VersionName value object now accepts x.y.z.w format
- changelog field is now optional in upload version DTO
- profile page: ensure expired section has full width

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 06:54:55 -08:00
hailin 001b6501a0 feat(deposit): add deposit balance API and Kafka consumer for deposit events
Blockchain Service:
- Add /api/v1/deposit/balances endpoint to query on-chain USDT balances
- Add JWT authentication (passport, passport-jwt)
- Add JwtStrategy, JwtAuthGuard, Public decorator

Wallet Service:
- Add Kafka consumer for blockchain.deposits topic
- Add DepositConfirmedHandler to process deposit events and update wallet balance

Infrastructure:
- Add JWT_SECRET env var to blockchain-service in docker-compose.yml
- Add blockchain-service routes to Kong API Gateway

Frontend:
- Fix deposit_service.dart API path (remove duplicate /api prefix)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 02:29:31 -08:00
hailin 26ecb39476 fix(mobile-app): pass referral code to backend during account creation
- Add inviterReferralCode storage key for temporary referral code storage
- Save referral code in guide page before navigating to onboarding
- Read and pass referral code to createAccount API in onboarding page
- Clear temp storage after successful account creation
- Improve QR code extraction to prioritize query params (?ref=, ?code=)

This fixes a critical bug where referral relationships were never
being established because the frontend wasn't passing the referral
code to the backend.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 02:10:57 -08:00