重构(会员): 会员表列改为 plan 与自然月账期,订单落权益变更快照

profile_membership 删除 tier / cycle_period_days 与四个会员商品权益列,末位追加 plan、cycle_index、cycle_count、cycle_kind

profile_recharge_product_config 删除 tier 与四个会员权益列,只保留充点商品;会员商品不再落该表

profile_recharge_order 末位追加会员变更快照列(变更类型、前后档位、前后周期、补点数、前后到期日 / 刷新日、价格快照)

会员周期刷新改为按北京时间自然月从原始锚点重算,到期清月度余额、永久泥点不受影响

会员购买与升级改走目录表实时价格:有效期内同周期升档按补差报价,补点向下取整、金额向上到分

会员账本幂等锚改为订单维度(membership-period-grant / membership-upgrade-grant 加订单 ID)

充点商品迁移规则改为六档无首充赠送,旧首充赠送行与停用的 ¥128 / ¥328 行一并归一

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-10-02 15:54:28 +08:00
parent 01c7cc8b66
commit 03073564b1
2 changed files with 618 additions and 474 deletions
@@ -5,7 +5,7 @@
use serde::{Deserialize, Serialize};
use crate::RuntimeProfileMembershipPlanSnapshot;
use crate::RuntimeProfileMembershipPlanRecord;
#[cfg(any())]
use serde_json::Value;
@@ -1718,7 +1718,7 @@ pub struct RuntimeProfileRechargeCenterSnapshot {
pub wallet_balance: u64,
pub membership: RuntimeProfileMembershipSnapshot,
pub point_products: Vec<RuntimeProfileRechargeProductSnapshot>,
pub membership_plans: Vec<RuntimeProfileMembershipPlanSnapshot>,
pub membership_plans: Vec<RuntimeProfileMembershipPlanRecord>,
pub latest_order: Option<RuntimeProfileRechargeOrderSnapshot>,
pub has_points_recharged: bool,
pub daily_free_points: RuntimeProfileDailyFreePointsSnapshot,
@@ -2665,7 +2665,7 @@ pub struct RuntimeProfileRechargeCenterRecord {
pub wallet_balance: u64,
pub membership: RuntimeProfileMembershipRecord,
pub point_products: Vec<RuntimeProfileRechargeProductRecord>,
pub membership_plans: Vec<RuntimeProfileMembershipPlanSnapshot>,
pub membership_plans: Vec<RuntimeProfileMembershipPlanRecord>,
pub latest_order: Option<RuntimeProfileRechargeOrderRecord>,
pub has_points_recharged: bool,
pub daily_free_points: RuntimeProfileDailyFreePointsRecord,
File diff suppressed because it is too large Load Diff