diff --git a/.trellis/workspace/zl-q/index.md b/.trellis/workspace/zl-q/index.md index 72a6c4b..adab2d4 100644 --- a/.trellis/workspace/zl-q/index.md +++ b/.trellis/workspace/zl-q/index.md @@ -8,7 +8,7 @@ - **Active File**: `journal-1.md` -- **Total Sessions**: 1 +- **Total Sessions**: 2 - **Last Active**: 2026-04-16 @@ -19,7 +19,7 @@ | File | Lines | Status | |------|-------|--------| -| `journal-1.md` | ~80 | Active | +| `journal-1.md` | ~156 | Active | --- @@ -29,6 +29,7 @@ | # | Date | Title | Commits | |---|------|-------|---------| +| 2 | 2026-04-16 | 新人初始礼包购买追踪功能实现 | `ff40ff9`, `fd0df28` | | 1 | 2026-04-16 | 新人初始礼包购买追踪功能 - 计划制定 | - | @@ -38,4 +39,4 @@ - Worktree workspace for: `worktree/feat-starter-package-purchase-tracking` - Sessions are appended to journal files -- New journal file created when current exceeds 2000 lines +- New journal file created when current exceeds 2000 lines \ No newline at end of file diff --git a/.trellis/workspace/zl-q/journal-1.md b/.trellis/workspace/zl-q/journal-1.md index 67b092c..42ab684 100644 --- a/.trellis/workspace/zl-q/journal-1.md +++ b/.trellis/workspace/zl-q/journal-1.md @@ -82,3 +82,75 @@ ### Status # **In Progress** - 计划已制定,等待实现 + + +## Session 2: 新人初始礼包购买追踪功能实现 + +**Date**: 2026-04-16 +**Task**: 新人初始礼包购买追踪功能实现 + +### Summary + +(Add summary) + +### Main Changes + +## 功能概述 + +实现新人初始礼包购买追踪功能,支持动态套餐配置和按国家/地区区分。 + +## 后端实现 + +| 模块 | 变更 | +|------|------| +| 数据库 | 添加 `has_purchased_starter_pack` 字段到 `register_bonus_claims` | +| 配置管理 | 创建 `backend/src/core/config/packages/` 静态配置加载层 | +| 路径工具 | 创建 `backend/src/utils/paths.py` 统一路径管理 | +| API | 新增 `GET /api/v1/points/packages` 返回可用套餐 | +| 默认值 | Profile 默认国家改为 `US`(ISO 3166-1 alpha-2) | + +## 前端实现 + +| 模块 | 变更 | +|------|------| +| 数据模型 | 创建 `ProductCode` 枚举约束,前后端类型安全 | +| API 调用 | 新增 `PointsApi.getPackages()` | +| UI | `CoinCenterScreen` 动态渲染套餐,移除硬编码 | +| l10n | 添加 `settingsCoinPackStarter` 翻译 | + +## 配置文件 + +- `backend/src/core/config/static/packages/us.yaml` - 美国区套餐配置 +- `backend/src/core/config/static/packages/default.yaml` - 默认套餐配置 + +## 技术亮点 + +- ProductCode 枚举约束:后端 Pydantic Literal + 前端 Dart enum +- 统一路径管理:移除 5 处硬编码路径拼接 +- Cross-layer 检查:修复 `profile_api.dart` fallback 不一致问题 + +## 文件统计 + +- 38 files changed +- +1452 insertions +- -2535 deletions + + +### Git Commits + +| Hash | Message | +|------|---------| +| `ff40ff9` | (see git log) | +| `fd0df28` | (see git log) | + +### Testing + +- [OK] (Add test results) + +### Status + +[OK] **Completed** + +### Next Steps + +- None - task complete