chore: record journal

This commit is contained in:
qzl
2026-04-13 11:26:23 +08:00
parent 4b258bb4d0
commit ed8c2e3058
2 changed files with 54 additions and 3 deletions
+4 -3
View File
@@ -8,8 +8,8 @@
<!-- @@@auto:current-status --> <!-- @@@auto:current-status -->
- **Active File**: `journal-1.md` - **Active File**: `journal-1.md`
- **Total Sessions**: 2 - **Total Sessions**: 3
- **Last Active**: 2026-04-10 - **Last Active**: 2026-04-13
<!-- @@@/auto:current-status --> <!-- @@@/auto:current-status -->
--- ---
@@ -19,7 +19,7 @@
<!-- @@@auto:active-documents --> <!-- @@@auto:active-documents -->
| File | Lines | Status | | File | Lines | Status |
|------|-------|--------| |------|-------|--------|
| `journal-1.md` | ~131 | Active | | `journal-1.md` | ~181 | Active |
<!-- @@@/auto:active-documents --> <!-- @@@/auto:active-documents -->
--- ---
@@ -29,6 +29,7 @@
<!-- @@@auto:session-history --> <!-- @@@auto:session-history -->
| # | Date | Title | Commits | | # | Date | Title | Commits |
|---|------|-------|---------| |---|------|-------|---------|
| 3 | 2026-04-13 | 积分重注册余额恢复验证 | - |
| 2 | 2026-04-10 | 静态通知同步 + 积分审计 bug 修复 | `3f3d613` | | 2 | 2026-04-10 | 静态通知同步 + 积分审计 bug 修复 | `3f3d613` |
| 1 | 2026-04-10 | 实现站内通知系统 | `3f3d613` | | 1 | 2026-04-10 | 实现站内通知系统 | `3f3d613` |
<!-- @@@/auto:session-history --> <!-- @@@/auto:session-history -->
+50
View File
@@ -129,3 +129,53 @@
### Next Steps ### Next Steps
- None - task complete - None - task complete
## Session 3: 积分重注册余额恢复验证
**Date**: 2026-04-13
**Task**: 积分重注册余额恢复验证
### Summary
完成 register_bonus_claims 快照方案的本地迁移与集成测试验证,确认删除账号后重注册可恢复删除前积分余额。
### Main Changes
| Feature | Description |
|---------|-------------|
| DB Migration | 通过 `dev-migrate.sh migrate` 应用 `20260413_0004_register_bonus_claims_snapshot`,新增 `first_user_id_snapshot``balance_snapshot`,移除 `first_user_id`。 |
| Restore Logic | 注册流程优先读取 `balance_snapshot` 恢复余额;删除账号前写入当前余额快照。 |
| Integration Tests | 新增未消费删号重注册恢复场景,并更新已有消费后删号重注册断言。 |
**Updated Files**:
- `backend/alembic/versions/20260413_0004_register_bonus_claims_snapshot.py`
- `backend/src/models/register_bonus_claims.py`
- `backend/src/v1/points/repository.py`
- `backend/src/v1/points/service.py`
- `backend/src/v1/users/service.py`
- `backend/tests/integration/test_register_run_delete_reregister.py`
- `backend/tests/unit/test_points_service_audit.py`
- `docs/protocols/common/user-points-chat-data-protocol.md`
**Verification**:
- `uv run pytest backend/tests/unit/test_points_service_audit.py` -> 5 passed
- `uv run pytest backend/tests/integration/test_register_run_delete_reregister.py` -> 2 passed
- Supabase MCP 查询确认 `register_bonus_claims.balance_snapshot` 已写入并与测试行为一致。
### Git Commits
(No commits - planning session)
### Testing
- [OK] (Add test results)
### Status
[OK] **Completed**
### Next Steps
- None - task complete