feat: implement WeChat cross-batch refund reconciliation and fix misc issues #1

Merged
clz merged 1 commits from dev into master 2026-06-26 17:13:03 +08:00
Owner

WeChat cross-batch refund reconciliation:

  • Add OriginalAmount field to CleanedBill for accurate cumulative refund math
  • DeduplicateRawFile detects WeChat status-update rows (已退款/已全额退款) and
    emits WechatRefundUpdates for Go-side reconciliation (Scenario 1)
  • WechatPy cleaner surfaces -退款 income rows with no same-batch expense match
    as unresolved_refunds for Go ReconcileRefund (Scenario 2)
  • Add ReconcileWechatRefund to repository interface and MongoDB implementation
  • upload.go step 15 iterates WechatRefundUpdates and reconciles against bills_cleaned

Bug fixes:

  • ReviewStats: add nil repo check to prevent panic when DB is not connected
  • JWT: remove hardcoded fallback secret; return 500/401 if JWTSecret not configured
  • Remove unused parsePageParam dead code and its strconv import
  • BillDetailDrawer: show 不计收支 amount in muted gray instead of red
  • test_jd_cleaner.py: replace hardcoded D:\Projects\BillAI path with dynamic file resolution

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

WeChat cross-batch refund reconciliation: - Add OriginalAmount field to CleanedBill for accurate cumulative refund math - DeduplicateRawFile detects WeChat status-update rows (已退款/已全额退款) and emits WechatRefundUpdates for Go-side reconciliation (Scenario 1) - WechatPy cleaner surfaces -退款 income rows with no same-batch expense match as unresolved_refunds for Go ReconcileRefund (Scenario 2) - Add ReconcileWechatRefund to repository interface and MongoDB implementation - upload.go step 15 iterates WechatRefundUpdates and reconciles against bills_cleaned Bug fixes: - ReviewStats: add nil repo check to prevent panic when DB is not connected - JWT: remove hardcoded fallback secret; return 500/401 if JWTSecret not configured - Remove unused parsePageParam dead code and its strconv import - BillDetailDrawer: show 不计收支 amount in muted gray instead of red - test_jd_cleaner.py: replace hardcoded D:\Projects\BillAI path with dynamic __file__ resolution Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
clz added 1 commit 2026-06-26 17:12:56 +08:00
WeChat cross-batch refund reconciliation:
- Add OriginalAmount field to CleanedBill for accurate cumulative refund math
- DeduplicateRawFile detects WeChat status-update rows (已退款/已全额退款) and
  emits WechatRefundUpdates for Go-side reconciliation (Scenario 1)
- WechatPy cleaner surfaces -退款 income rows with no same-batch expense match
  as unresolved_refunds for Go ReconcileRefund (Scenario 2)
- Add ReconcileWechatRefund to repository interface and MongoDB implementation
- upload.go step 15 iterates WechatRefundUpdates and reconciles against bills_cleaned

Bug fixes:
- ReviewStats: add nil repo check to prevent panic when DB is not connected
- JWT: remove hardcoded fallback secret; return 500/401 if JWTSecret not configured
- Remove unused parsePageParam dead code and its strconv import
- BillDetailDrawer: show 不计收支 amount in muted gray instead of red
- test_jd_cleaner.py: replace hardcoded D:\Projects\BillAI path with dynamic __file__ resolution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
clz merged commit 961b63ea77 into master 2026-06-26 17:13:03 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: clz/billai#1