Commit Graph

391 Commits

Author SHA1 Message Date
k88936 796cf9843c Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / AI game creator shell Rust crates (pull_request) Successful in 6m0s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m43s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m42s
Project CI / Frontend tests (pull_request) Failing after 1m16s
Project CI / Backend tests (pull_request) Successful in 8m51s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m34s
Project CI / Repository checks (pull_request) Successful in 5m34s
Project CI / Native shell tests (pull_request) Successful in 7m18s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-06 10:14:15 +08:00
lhk229 51cb05f418 补充创作者主页与关注粉丝工程文档 (#638)
Project CI / AI game creator shell Rust crates (push) Successful in 5m56s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 6m36s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 7m37s
Project CI / Backend tests (push) Successful in 9m22s
Project CI / Frontend tests (push) Successful in 4m40s
Project CI / AI game creator shell web tests (push) Successful in 3m50s
Project CI / Repository checks (push) Successful in 6m30s
Project CI / Native shell tests (push) Successful in 8m32s
本 PR 补齐创作者主页与关注粉丝功能的产品合同和工程设计,供后续按里程碑实施;本次只修改文档。

桌面导航第四项进入自己的创作者主页,“我的”移到第五项。游戏详情可进入作者主页并关注/取消关注;自己或他人的关注、粉丝列表均公开可查看,点击用户头像或昵称可进入其主页。本人支持取消/重新关注、回关和移除粉丝,并明确两个关注方向独立。

工程设计包含关系表与 DTO、认证和事务边界、跨页状态同步、共享组件、深链及验收要求,拆分关系查询和页面交互两个里程碑。按用户要求,游戏列表沿用最多 48 项的现有限制,不增加游戏目录分页改造。

验证:
- 已合入最新 origin/master(21c79f54a);共享决策记录冲突保留双方新增内容。
- npm run check:encoding 通过。
- npm run check:doc-index 通过。
- git diff --check 与暂存差异检查通过。
- 相对 master 仅六份文档发生变化;没有业务代码或 schema 修改,未执行业务测试或部署。

Reviewed-on: #638
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
2026-10-05 22:05:11 +08:00
k88936 e27ce5573f 修复(会员档位): 缺行目录改为逐档回填并在写入前校验覆盖
- ensure_default_profile_membership_plan 从「空表整表播种」改为按目录逐档补齐缺失行,已存在行不覆盖后台改价
- 新增 missing_runtime_profile_membership_plan_rows 纯函数并在 module-runtime 根导出,回填逻辑可单测
- validate_runtime_profile_membership_plan_row_against_catalog 增加「existing 必须覆盖除 candidate 外全部档位」校验,缺行直接拒绝写入
- 更新 init 注释:懒补齐而非懒播种,全部档位补齐后幂等无写
- 补缺行拒绝与回填幂等两条目录单测
2026-10-05 20:22:37 +08:00
k88936 00bb2a7b15 修复(会员审计): 后台改档时间改用 SpacetimeDB 事务时间
- upsert_profile_membership_plan_record 不再信任入参 updated_at_micros
- updated_at / created_at 统一取 ctx.timestamp,客户端时钟无法伪造审计时间
2026-10-05 19:24:57 +08:00
k88936 6374c7c445 重构(会员升级): 目录倒挂用独立 rejection 与配置错误码
- 新增 RuntimeProfileMembershipUpgradeRejection::CatalogPricingInverted
- 报价遇到价格 / 每期泥点相等或倒挂时返回该变体,不再复用 InvalidQuoteInput
- rejection.error_code() 把目录倒挂映射为 InvalidPlanConfig,人读文案保留原因
- profile.rs 三处统一用 membership_upgrade_rejection_error,并重导出该 rejection 类型
- api-server 补 400 + invalid_plan_config 映射断言
2026-10-05 19:23:00 +08:00
k88936 0930e402be 修复(会员错误码): 修正 ProductIdUnparseable 拼写
- module-runtime 变体 ProductIdUnparsable 改名为 ProductIdUnparseable,wire 串 product_id_unparsable 同步改为 product_id_unparseable(本 PR 未上线,不留兼容)
- 同步 spacetime-module 拒绝点、spacetime-client mapper 与 api-server 测试引用,并重新生成 SpacetimeDB 绑定
- 同步设计文档 §5.8 与决策日志
2026-10-05 15:32:19 +08:00
k88936 c3866b4267 修复(后台邀请码): 拒绝补机器可读错误码走 400
- module-runtime 新增 RuntimeProfileInviteCodeAdminErrorCode(invalid_field / in_use),两个后台邀请码 procedure 结果末尾追加 error_code
- module 侧用 ProfileInviteCodeAdminProcedureError 在拒绝点赋码,字段校验统一 invalid_field、被他人占用归 in_use
- spacetime-client mapper 有码走 ProcedureRejected,并把 api-server 映射注释收窄为「带 typed code 的四条链路」
- 重新生成 SpacetimeDB 绑定;补 client 与 api-server 单测;同步设计文档 §5.8 与决策日志
2026-10-05 14:22:39 +08:00
k88936 4f3faa04b5 修复(后台兑换码): 管理拒绝补机器可读错误码走 400
Project CI / Backend tests (pull_request) Failing after 53s
Project CI / Native shell tests (pull_request) Failing after 3m51s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m25s
Project CI / Frontend tests (pull_request) Failing after 48s
Project CI / AI game creator shell web tests (pull_request) Failing after 43s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m17s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m6s
Project CI / Repository checks (pull_request) Successful in 4m37s
- module-runtime 新增 RuntimeProfileRedeemCodeAdminErrorCode(not_found / invalid_field / allowed_users_required),后台兑换码增改与列表 procedure 结果末尾追加 error_code
- module 侧用 ProfileRedeemCodeAdminProcedureError 在拒绝点赋码,字段校验统一 invalid_field、私有码缺用户 allowed_users_required
- spacetime-client 后台 mapper 有码走 ProcedureRejected,api-server 由此返回 400 而不是 502
- 重新生成 SpacetimeDB 绑定;补 client 与 api-server 单测;同步设计文档 §5.8 与决策日志
2026-10-05 12:35:55 +08:00
k88936 a48b7f8de8 Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / Backend tests (pull_request) Failing after 48s
Project CI / Native shell tests (pull_request) Failing after 3m50s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m21s
Project CI / Frontend tests (pull_request) Failing after 47s
Project CI / AI game creator shell web tests (pull_request) Failing after 39s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m6s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m23s
Project CI / Repository checks (pull_request) Successful in 6m31s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-05 10:50:30 +08:00
k88936 14c147722a fix(会员结算): cycle_index==0 迁移行按 max(1) 归一,避免误判状态已变化
- frozen_membership_cycle_matches 比较双方都按 max(1) 归一(评审第 20 条)
- 存量 cycle_index 为 0 的会员行与投影的 Some(1) 快照现在判定一致,不再永久返回「会员状态已变化,请重新下单」
- 扩展 frozen_membership_cycle_identity_rejects_advanced_cycle 覆盖迁移行;已验证去掉 max(1) 时用例失败
2026-10-04 21:51:42 +08:00
k88936 284b656b59 fix(充值商品): 移除已退役的 bonus_points / duration_days 入参
- 后台 upsert 请求 DTO 与 SpacetimeDB procedure 入参移除 bonus_points、duration_days(评审第 19 条)
- 充点商品固定「¥1 = 10 泥点、无首充赠送」,module 落库统一写 0,保留退役列兼容存量 schema
- 删除 InvalidRechargeProductFields 校验与错误文案;api-server / spacetime-client 同步收敛
- admin-web 表单移除「首充赠送」输入与状态,列表改为只展示基础泥点
- scripts/admin-web-fake-api.mjs 假数据同步 bonusPoints: 0
2026-10-04 21:33:39 +08:00
k88936 bd06e42690 refactor(error): profile 错误分类全面转 typed error,删除文案匹配
- module-runtime 新增 RuntimeProfileRewardCodeRedeemErrorCode(NotFound/Disabled/NotStarted/Expired/UsesExhausted/NotAllowedForUser/InvalidReward)与 RuntimeProfileProcedureRejectionCode(聚合会员 / 兑换码两类码)
- RuntimeProfileRewardCodeRedeemProcedureResult 末尾追加 error_code,spacetime-module 用 ProfileRewardCodeRedeemProcedureError 在拒绝点显式赋码,入参与钱包错误保持无码
- SpacetimeClientError::ProcedureRejected.code 改为 RuntimeProfileProcedureRejectionCode,Display 输出 [code] message,不再吞掉机器可读原因(评审第 12 条)
- api-server 的 map_runtime_profile_client_error 只读变体字段,AppError.code 取 code.as_str(),删除 is_runtime_profile_domain_error / is_runtime_profile_redeem_code_domain_error 两个中文文案匹配函数
- 重新生成 Rust bindings;同步技术设计 §5.8 与 decision-log
2026-10-04 18:40:54 +08:00
suzmii 2f6df57ce2 Merge remote-tracking branch 'origin/master' into feat/game-works-management
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m32s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m5s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 3m33s
Project CI / Frontend tests (pull_request) Successful in 3m39s
Project CI / Backend tests (pull_request) Successful in 6m49s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m39s
Project CI / Repository checks (pull_request) Successful in 6m43s
Project CI / Native shell tests (pull_request) Successful in 7m39s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
#	docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md
#	server-rs/crates/api-server/src/modules/game_distribution.rs
#	server-rs/crates/spacetime-client/src/active.rs
#	server-rs/crates/spacetime-module/src/game_distribution.rs
#	src/components/game-distribution/GameDistributionPages.test.tsx
2026-10-04 15:00:23 +08:00
k88936 c391352ff4 fix(会员): 并发上限按有效档位解析,过期会员回落 Normal
- effective_profile_concurrent_job_limit 原先直接读 profile_membership.plan;该列到期后仍保留最近购买档位,过期 Max 会继续拿 128 不限并发哨兵
- 补 expires_at 有效性过滤,与 build_profile_membership_snapshot_from_row 的对外口径一致;缺会员行 / 已过期按 Normal
2026-10-04 13:29:32 +08:00
k88936 2e13334fd7 perf(会员): 在飞 running 计数下推到 owner_status 索引范围
- count_running_external_generation_jobs_for_owner 原先把 status 当 Rust 后置过滤,owner 的 pending 积压也会被物化
- 改为 (owner_user_id, status) 复合条件,直接走 btree 范围,语义不变
2026-10-04 13:29:32 +08:00
k88936 ce464168ce docs(会员): 标注外部生成认领的跨账号队头阻塞 TODO
- claim_external_generation_jobs_tx 的 take(limit) 只检查前 limit 行,被上限拦下/lease 终结的行仍占检查名额
- 记录触发条件(负载越高 limit 越小)与未决修法(改为成功认领才计数,仍是全局 FIFO),本次不修
2026-10-04 13:29:32 +08:00
k88936 cf40df6be3 feat(会员): 新增只读 AGC 模型权限 procedure 与客户端访问器
- module-runtime 新增 RuntimeProfileAgcModelAccessSnapshot / ProcedureResult 领域类型
- spacetime-module 新增 get_profile_agc_model_access_and_return:只读会员账期投影 + 档位目录 model_access,缺目录行失败关闭 Basic
- 重新生成绑定并补 spacetime-client get_profile_agc_model_access 与结果映射
2026-10-04 13:29:05 +08:00
k88936 1d09d7e061 perf(会员): 外部生成认领按账号折叠并发上限与在飞计数查询
- 新增 ExternalGenerationOwnerConcurrencyCache:单次 claim 事务内按账号只查一次 concurrent_job_limit,running 计数按账号缓存
- 认领 / lease 耗尽终结后失效该账号 running 缓存,判定结果与逐候选行现查一致
- 回收豁免与不限档不再触发 running 计数查询;补缓存失效单测
2026-10-04 13:28:26 +08:00
k88936 103280025c feat(会员): 外部生成认领按账号并发上限过滤
- external_generation_job 追加 (owner_user_id, status) 组合索引,认领事务内现算 running 行数,不建计数表
- claim_external_generation_jobs_tx 认领前判定会员并发上限:达上限的 pending 保持排队
- 账号自身过期 running 的回收豁免上限,避免超限账号卡死任务无法回收
- profile.rs 新增 effective_profile_concurrent_job_limit:缺会员行按 Normal、缺目录行失败关闭到 1
- 抽取纯函数 external_generation_claim_within_concurrency_limit 并补单元测试
2026-10-04 13:28:13 +08:00
k88936 65b9821d25 Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-04 13:27:20 +08:00
k88936 9d7ca1b3b7 文档(会员目录):明确懒播种策略与只读入口首次写库的副作用
- ensure_default_profile_membership_plan 注释说明 init 与读取 helper 共用、目录空时首次读取会写库
- init_profile_membership_plan_catalog 注释改为不覆盖「表已存在但为空」的存放量库
- 报价与建单注释去掉「不写库」的绝对说法,注明目录空时的懒播种例外
- 同步设计文档 7 / 10.2 与决策日志(播种策略定为保留懒播种 + 明示副作用)
2026-10-04 13:20:06 +08:00
k88936 68c8544a15 类型化(会员错误):会员业务拒绝改用机器可读 error_code
- module-runtime 新增 RuntimeProfileMembershipErrorCode 与 RuntimeProfileMembershipDomainError
- 会员报价 / 充值中心 / 后台档位 upsert 的 procedure 结果末尾追加 error_code
- spacetime-module 在拒绝点显式赋码,中文 error_message 逐字保持不变
- spacetime-client 新增 SpacetimeClientError::ProcedureRejected 并映射生成绑定
- api-server 删除会员中文前缀分类,改按 error_code 返回 400,基础设施错误仍 502
- 重生成 module_bindings,并同步设计文档 5.8 与决策日志
2026-10-04 12:41:26 +08:00
k88936 57e259278d Merge remote-tracking branch 'origin/master' into feat/play-count-with-cache
Project CI / Backend tests (pull_request) Failing after 36s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m28s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m41s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
2026-10-04 11:58:25 +08:00
k88936 c660ca41fe 枚举化(会员):快照与报价/档位响应改用 typed enum
- shared-contracts 新增 ProfileMembershipPlan/CycleKind/ModelAccess/ChangeKind Token 枚举
- RuntimeProfileMembershipOrderChangeSnapshot 与 UpgradeQuoteRecord 档位/周期改用模块枚举
- AdminMembershipOrderChangePayload、ProfileMembership/Plan/UpgradeQuote Response 改用 token 枚举
- module-runtime 提供模块枚举与 wire token 的双向 From 映射
- api-server / spacetime-client / spacetime-module 同步去掉 as_str().to_string() 拼装
- 重生成 SpacetimeDB 绑定:订单变更快照字段改为枚举
2026-10-04 11:43:57 +08:00
k88936 1744262b0b 对齐(会员订单):granted_points_delta 全链路 i64 改 u64
- profile_recharge_order.membership_granted_points_delta 列由 i64 改为 u64
- RuntimeProfileMembershipOrderChangeSnapshot 与 AdminMembershipOrderChangePayload 同步改 u64
- 删除 snapshot/order 之间的 as i64 与 try_from 兜底转换
- 重生成 SpacetimeDB 绑定:profile_recharge_order、订单变更快照
2026-10-04 11:23:21 +08:00
k88936 168028d5e5 修正(会员账期):期号水位缺失不再被当成换期重发额度
- advance_profile_membership_cycle_to 只在 cycle_resets_at 缺失时判定需要初始化写库
- cycle_index == 0(新列默认值)只补写期号水位,不重置 cycle_granted/remaining_points
- 补测试覆盖 cycle_index=0 且账期窗口已存在时保留本期余额
2026-10-04 11:21:42 +08:00
k88936 44feb7b0f5 修正(会员后台):缺少目录档位时不再回退 rank 0
- upsert 解析 rank 失败改为显式报错,避免与 Normal 占位同档
- 与 module-runtime 用 Option 暴露缺失档位的契约保持一致
2026-10-04 10:33:58 +08:00
k88936 dfa92607b4 Merge remote-tracking branch 'origin/master' into feat/pricing-plan
Project CI / Backend tests (pull_request) Failing after 1m51s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m10s
Project CI / Frontend tests (pull_request) Failing after 1m31s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m59s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m50s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m38s
Project CI / Repository checks (pull_request) Failing after 4m27s
Project CI / Native shell tests (pull_request) Successful in 7m43s
# Conflicts:
#	docs/project-memory/shared-memory/decision-log.md
#	server-rs/crates/module-runtime/src/lib.rs
2026-10-03 20:32:40 +08:00
k88936 5826b2e56c fix(会员结算): 升级单冻结账期身份并在支付时校验
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
- ProfileMembershipOrderSnapshot / ProfileMembershipSettlement 增加 cycle_index_before 与 cycle_resets_at_before_micros,建单时写入订单已有的会员快照列,不新增 schema 字段。
- 支付结算前比对冻结期号与刷新时刻,账期已推进则返回「会员状态已变化,请重新下单」,避免按旧周期剩余比例算出的补点叠加到已重置的新周期。
- 抽出 frozen_membership_cycle_matches 纯函数并补单测;历史无快照订单冻结值为 None,跳过校验。
2026-10-03 20:18:27 +08:00
k88936 0fc564c4e5 fix(会员结算): 拒绝过期新购单覆盖更新的会员
- 冻结的新购单下单时用户无有效会员,若支付前已通过其他订单获得有效会员,结算会按 user_id 删除重插,覆盖更新 / 更长的会员。
- 在 apply_profile_membership_purchase 中当 change_kind 为 Purchase 且 active_row 存在时返回「会员状态已变化,请重新下单」,与升级分支守卫一致。
- 历史无快照的重算路径只会在 active_row 为空时产出 Purchase,不受影响。
2026-10-03 19:42:36 +08:00
k88936 5603185a7f refactor(会员报价): 升级报价快照档位与周期改用枚举
- RuntimeProfileMembershipUpgradeQuoteSnapshot 的 current_plan / target_plan / cycle_kind 由 String 改为 RuntimeProfileMembershipPlan / RuntimeProfileMembershipCycleKind,把非法值挡在类型边界外。
- 模块构造点直接写入枚举;记录侧在 build_runtime_profile_membership_upgrade_quote_record 用 as_str() 转回对外 token,HTTP 契约不变。
- spacetime-client 映射改用 plan / cycle_kind 的 back 映射还原枚举;重新生成 module_bindings。
2026-10-03 19:39:34 +08:00
k88936 3db258d927 fix(会员账期): 非法北京本地时间改用 None 表达
- beijing_local_micros 返回 Option<i64>,不再用 0 兼作非法哨兵,合法 epoch 0 可被区分。
- advance_beijing_months_clamped 对夹取后的合法输入 expect,相关测试助手同步更新。
- 补 beijing_local_micros 区分合法 epoch 与非法输入的用例。
2026-10-03 19:26:36 +08:00
k88936 888a94ac86 fix(会员): 存量库首次读取补种会员档位目录
- profile.rs 在 membership_plan_row / membership_plan_records 恢复懒播种,避免增量发布不触发 init reducer 导致 profile_membership_plan 为空。

- 下单校验、升级报价、充值中心读取目录前都会先补种代码内种子目录。
2026-10-03 19:05:26 +08:00
k88936 cc33c39f24 后端:新增批量游玩计数 procedure 与生成绑定
- spacetime-module/game_distribution.rs:新增 GameDistributionPlayCountIncrement(Input) 与 increment_game_distribution_game_play_counts_and_return,事务内只对 published 且有 active_version_id 的游戏 saturating_add,且不 bump updated_at
- 重新执行 npm run spacetime:generate,新增 3 个绑定并同步 module_bindings.rs 等生成产物
2026-10-03 18:04:47 +08:00
k88936 ba451bfc0c fix(会员): 退役列保留不删,发布改回追加式兼容
- domain.rs 恢复已退役的 RuntimeProfileMembershipTier 枚举,仅供存量 tier 列兼容。

- profile.rs 将 profile_membership 的 tier / cycle_period_days 还原到原始位置,新字段 plan / cycle_index / cycle_count / cycle_kind 末位追加。

- profile.rs 恢复 profile_recharge_product_config 的 tier 与 membership_* 兼容列,运行时不读不写、写入统一用固定默认值。

- 重新生成 module_bindings;schema guard 无需 allow-breaking 即通过,发布不再触发导出 / 清库 / 回灌。

- 数据契约文档同步标注退役列与六档泥点商品。
2026-10-03 17:59:31 +08:00
k88936 0c93256b8c Revert "fix(迁移): 补齐会员重构的破坏性迁移导入兼容"
This reverts commit 21f69ef13b.
2026-10-03 17:44:30 +08:00
k88936 bc5552a5ea Revert "fix(会员): 回灌后收敛充点商品目录并清理退役会员商品行"
This reverts commit af0721fb78.
2026-10-03 17:44:30 +08:00
suzmii f4ca1aeecc 合并最新 master 到作品管理分支
Project CI / Backend tests (pull_request) Failing after 39s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m44s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 3m43s
Project CI / Repository checks (pull_request) Failing after 40s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m52s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m12s
Project CI / Native shell tests (pull_request) Successful in 6m41s
2026-10-03 17:34:23 +08:00
k88936 af0721fb78 fix(会员): 回灌后收敛充点商品目录并清理退役会员商品行
- profile.rs 新增 converge_default_profile_recharge_product_config,在存量库读取路径补齐缺失的 points_1280 / points_3280 档位。

- 同一步骤删除已退役的 membership 类型充点商品配置行,避免冲突迁移把旧 member_* 行原样带回后残留。

- 存量库充值商品目录因此幂等收敛到当前六档点卡,不再停留在旧四档 + 四行会员商品。
2026-10-03 17:24:00 +08:00
kdletters 4b529a8952 新增支付服务接入与订单收银台
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m59s
Project CI / Backend tests (pull_request) Failing after 4m8s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 5m9s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m20s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m48s
Project CI / Repository checks (pull_request) Failing after 4m15s
Project CI / Native shell tests (pull_request) Successful in 6m52s
新增支付应用、API Key 与外部产品订单接口

接入微信 Native 下单、二维码收银台与支付结果回调

新增后台支付订单与回调投递页面

补齐 SpacetimeDB 支付表、生成绑定、OpenAPI 与使用说明
2026-10-03 17:18:13 +08:00
k88936 21f69ef13b fix(迁移): 补齐会员重构的破坏性迁移导入兼容
- migration.rs 为旧迁移包回填 profile_membership 的 plan / cycle_index / cycle_count / cycle_kind 默认值。

- migration.rs 为旧迁移包回填 profile_recharge_order 的 14 个 membership_* 快照默认值,避免回灌导入因缺列失败。

- 新增两条单元测试守护会员表与订单快照的旧包默认值。

- 同步后端架构文档的 profile_membership / profile_recharge_product_config / profile_recharge_order 表目录。

- 记录 SpacetimeDB 2.8.3 持久表删列需显式迁移的实测结论与既有 run_conflict_migration_publish 路径。
2026-10-03 17:11:04 +08:00
suzmii 7bf7d6b10e 支持统一版本回退与重复提交
Project CI / Backend tests (pull_request) Failing after 54s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m22s
Project CI / Frontend tests (pull_request) Successful in 2m8s
Project CI / Repository checks (pull_request) Failing after 17s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m23s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 4m27s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m3s
Project CI / Native shell tests (pull_request) Successful in 5m18s
以 projectVersion 作为唯一用户版本标签,允许同版本重复提交和版本回退。

按 versionId 保持提交实例不可变,取消同版本旧 pending 提交并按最近提交排序。
2026-10-03 16:55:00 +08:00
k88936 43f0c51120 后台用户详情改走只读会员快照
新增只读会员快照 procedure get_profile_membership_snapshot_and_return,不刷新钱包 / 账期、不写库
module-runtime 新增 RuntimeProfileMembershipGetInput 与 RuntimeProfileMembershipSnapshotProcedureResult 及入参构造器
spacetime-client 增加 get_profile_membership_snapshot facade、From 转换与结果映射,并同步生成绑定
build_profile_membership_snapshot 拆成写库与纯读两条路径,共用 from_row 投影
admin_get_user_detail 改用只读会员快照,打开详情不再改用户钱包与会员账期
2026-10-03 16:42:48 +08:00
suzmii 3aa3e33ceb 实现统一项目发行版本
Project CI / AI game creator shell Rust crates (pull_request) Failing after 56s
Project CI / Backend tests (pull_request) Failing after 23s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 5m7s
Project CI / Repository checks (pull_request) Failing after 21s
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
以 projectVersion 作为 AGC 唯一用户版本,支持同版本重复提交和版本回退。

保留 publicationRevision 并发校验与旧客户端自动递增兼容。
2026-10-03 16:41:04 +08:00
k88936 6f0d773dde 会员档位目录种子改由模块初始化播种
新增 init 生命周期 reducer,数据库首次创建时把 profile_membership_plan 整表播种
membership_plan_row 与 membership_plan_records 去掉懒播种,只读路径不再写库
ensure_default_profile_recharge_product_config 不再顺带初始化会员目录
存量数据库此前已由懒播种写入目录行,新建数据库由 init reducer 播种
2026-10-03 16:27:04 +08:00
k88936 3031f58875 会员升级结算前校验订单冻结的变更前状态
结算补差升级单前比对 settlement.plan_before / cycle_kind_before 与当前会员行,不一致直接拒绝「会员状态已变化,请重新下单」
避免用户先付更高档位升级单后,旧升级单落地把档位 / 周期覆盖回去,出现降档或「年付 + 一个月到期」的矛盾行
api-server 把该业务拒绝映射为 400
2026-10-03 16:16:07 +08:00
k88936 3e2ab3cf78 会员充值下单不再接受客户端时间参数
RuntimeProfileRechargeOrderCreateInput 删除 created_at_micros 字段,procedure 入参不再携带时间
build_runtime_profile_recharge_order_create_input 同步去掉时间参数
spacetime-module 建单时刻改用 ctx.timestamp,避免客户端把时间设到会员到期前夕压低补差金额
spacetime-client facade 与 mapper、生成绑定同步去掉该字段
api-server 不再自算 current_unix_micros 传入
更新受影响的 module-runtime 单测调用
2026-10-03 16:15:36 +08:00
k88936 f9b0cf786d 会员升级补差订单到期后按新购价校验结算
新增 check_expired_membership_upgrade_settlement:补差订单在支付前会员已到期时,订单金额必须达到目标周期当前目录价才允许按新购结算,否则拒绝
新增 RuntimeProfileMembershipUpgradeRejection::MembershipExpiredBeforeSettlement 及错误码字符串
module-runtime 导出该判定函数供结算侧复用
spacetime-module 结算分支调用该判定,目录缺档位时返回明确错误
api-server 把「会员已到期,请按新购价格重新下单」映射为 400 业务错误
补充过期补差订单必须覆盖整期新购价的单元用例
2026-10-03 16:06:06 +08:00
suzmii 1621c29cf0 Merge remote-tracking branch 'origin/master' into feat/game-works-management 2026-10-03 15:43:20 +08:00
lhk229 ae2d1a3a21 修复 AGC 生成准备依赖全量素材库的问题 (#592)
Project CI / AI game creator shell Rust crates (push) Successful in 1m47s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 5m1s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 5m18s
Project CI / Frontend tests (push) Successful in 2m27s
Project CI / Backend tests (push) Successful in 5m49s
Project CI / Native shell tests (push) Successful in 6m21s
Project CI / Repository checks (push) Successful in 3m36s
Project CI / AI game creator shell web tests (push) Successful in 2m54s
修复已有项目和素材目录绑定时,AGC 生成准备仍读取完整账户素材库、导致无关素材读取失败阻断生成的问题。

- 新增站内与 External v1 的单目录 GET,按主键读取并校验账号归属;复用目录 DTO,不读取素材列表或创建默认目录。
- 已有 binding 和 partial 恢复改为确认目标目录;首次建绑直接沿用稳定幂等创建,不再读取全库。
- 目录缺失、越权、超时、响应身份不符或会话切换时停止,保留恢复证据,不自动重建、不换键重发生成;已有生成账本继续沿用冻结快照恢复。
- 既有素材库与目录创建、修改、删除 API 合同保持不变,持久化表结构不变。同步 OpenAPI、生成绑定及技术文档。

验证:
- AGC Rust:目录绑定 7 项、生成 94 项、资源编辑 60 项、抠图 5 项通过(目录绑定用例包含在生成组中)。
- api-server:External Editor 30 项、受保护路由矩阵 3 项通过。
- 真实隔离 SpacetimeDB:目录读取成功、空目录、缺失、越权、删除后缺失、只读不变,以及既有幂等/并发/孤儿检查通过。
- smoke 脚本测试 4 项通过;module 编译、生成绑定、87 张表 schema guard、DDD、编码、文档索引、定向 Rust 格式与 diff 检查通过。
- 已比较 OpenAPI:除新增单目录 GET 外,原有定义逐项保持一致。

验证限制:未完成独立 API `/healthz` 联调,本地隔离数据库与授权配置未就绪;启动尝试已停止并清理。未运行全量测试或真实付费生成。

发布顺序:先发布后端模块与 API,再发布新客户端;不提供全库回退。#574 的素材分页、筛选及按素材 ID 读取不在本 PR 范围内。

Closes #550

Reviewed-on: #592
Co-authored-by: Linghong <ink29535@proton.me>
Co-committed-by: Linghong <ink29535@proton.me>
2026-10-03 14:48:54 +08:00