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
This commit is contained in:
@@ -1131,8 +1131,6 @@ pub async fn admin_upsert_profile_recharge_product(
|
||||
payload.price_cents,
|
||||
kind,
|
||||
payload.points_amount,
|
||||
payload.bonus_points,
|
||||
payload.duration_days,
|
||||
payload.badge_label.unwrap_or_default(),
|
||||
payload.description.unwrap_or_default(),
|
||||
payload.enabled,
|
||||
|
||||
@@ -393,8 +393,6 @@ pub fn build_runtime_profile_recharge_product_admin_upsert_input(
|
||||
price_cents: u64,
|
||||
kind: RuntimeProfileRechargeProductKind,
|
||||
points_amount: u64,
|
||||
bonus_points: u64,
|
||||
duration_days: u32,
|
||||
badge_label: String,
|
||||
description: String,
|
||||
enabled: bool,
|
||||
@@ -414,9 +412,6 @@ pub fn build_runtime_profile_recharge_product_admin_upsert_input(
|
||||
if points_amount == 0 {
|
||||
return Err(RuntimeProfileFieldError::InvalidRechargeProductPoints);
|
||||
}
|
||||
if duration_days != 0 || bonus_points != 0 {
|
||||
return Err(RuntimeProfileFieldError::InvalidRechargeProductFields);
|
||||
}
|
||||
}
|
||||
// 中文注释:会员商品已迁移到 profile_membership_plan 目录,这里只保留泥点商品。
|
||||
RuntimeProfileRechargeProductKind::Membership => {
|
||||
@@ -431,8 +426,6 @@ pub fn build_runtime_profile_recharge_product_admin_upsert_input(
|
||||
price_cents,
|
||||
kind,
|
||||
points_amount,
|
||||
bonus_points,
|
||||
duration_days,
|
||||
badge_label: normalize_optional_string(Some(badge_label)).unwrap_or_default(),
|
||||
description: normalize_optional_string(Some(description)).unwrap_or_default(),
|
||||
enabled,
|
||||
|
||||
@@ -2082,8 +2082,6 @@ pub struct RuntimeProfileRechargeProductAdminUpsertInput {
|
||||
pub price_cents: u64,
|
||||
pub kind: RuntimeProfileRechargeProductKind,
|
||||
pub points_amount: u64,
|
||||
pub bonus_points: u64,
|
||||
pub duration_days: u32,
|
||||
pub badge_label: String,
|
||||
pub description: String,
|
||||
pub enabled: bool,
|
||||
|
||||
@@ -89,7 +89,6 @@ pub enum RuntimeProfileFieldError {
|
||||
InvalidRechargeProductPrice,
|
||||
InvalidRechargeProductPoints,
|
||||
InvalidRechargeProductKind,
|
||||
InvalidRechargeProductFields,
|
||||
InvalidMembershipPlan,
|
||||
InvalidMembershipPlanOrder,
|
||||
MissingPaymentChannel,
|
||||
@@ -185,9 +184,6 @@ impl std::fmt::Display for RuntimeProfileFieldError {
|
||||
Self::InvalidRechargeProductKind => {
|
||||
f.write_str("充值商品类型无效:会员商品已迁移到会员档位目录")
|
||||
}
|
||||
Self::InvalidRechargeProductFields => {
|
||||
f.write_str("泥点商品不支持 duration_days 与 bonus_points 字段")
|
||||
}
|
||||
Self::InvalidMembershipPlan => {
|
||||
f.write_str("会员档位配置无效:月价、年价、每期泥点与并发上限必须有效")
|
||||
}
|
||||
|
||||
@@ -820,8 +820,6 @@ pub struct AdminUpsertProfileRechargeProductRequest {
|
||||
pub price_cents: u64,
|
||||
pub kind: String,
|
||||
pub points_amount: u64,
|
||||
pub bonus_points: u64,
|
||||
pub duration_days: u32,
|
||||
#[serde(default)]
|
||||
pub badge_label: Option<String>,
|
||||
#[serde(default)]
|
||||
|
||||
@@ -580,8 +580,6 @@ impl From<module_runtime::RuntimeProfileRechargeProductAdminUpsertInput>
|
||||
price_cents: input.price_cents,
|
||||
kind: map_runtime_profile_recharge_product_kind(input.kind),
|
||||
points_amount: input.points_amount,
|
||||
bonus_points: input.bonus_points,
|
||||
duration_days: input.duration_days,
|
||||
badge_label: input.badge_label,
|
||||
description: input.description,
|
||||
enabled: input.enabled,
|
||||
|
||||
@@ -1699,8 +1699,6 @@ impl SpacetimeClient {
|
||||
price_cents: u64,
|
||||
kind: module_runtime::RuntimeProfileRechargeProductKind,
|
||||
points_amount: u64,
|
||||
bonus_points: u64,
|
||||
duration_days: u32,
|
||||
badge_label: String,
|
||||
description: String,
|
||||
enabled: bool,
|
||||
@@ -1714,8 +1712,6 @@ impl SpacetimeClient {
|
||||
price_cents,
|
||||
kind,
|
||||
points_amount,
|
||||
bonus_points,
|
||||
duration_days,
|
||||
badge_label,
|
||||
description,
|
||||
enabled,
|
||||
|
||||
-2
@@ -15,8 +15,6 @@ pub struct RuntimeProfileRechargeProductAdminUpsertInput {
|
||||
pub price_cents: u64,
|
||||
pub kind: RuntimeProfileRechargeProductKind,
|
||||
pub points_amount: u64,
|
||||
pub bonus_points: u64,
|
||||
pub duration_days: u32,
|
||||
pub badge_label: String,
|
||||
pub description: String,
|
||||
pub enabled: bool,
|
||||
|
||||
@@ -8500,8 +8500,6 @@ fn upsert_profile_recharge_product_config_record(
|
||||
input.price_cents,
|
||||
input.kind,
|
||||
input.points_amount,
|
||||
input.bonus_points,
|
||||
input.duration_days,
|
||||
input.badge_label,
|
||||
input.description,
|
||||
input.enabled,
|
||||
@@ -8533,8 +8531,9 @@ fn upsert_profile_recharge_product_config_record(
|
||||
price_cents: validated_input.price_cents,
|
||||
kind: validated_input.kind,
|
||||
points_amount: validated_input.points_amount,
|
||||
bonus_points: validated_input.bonus_points,
|
||||
duration_days: validated_input.duration_days,
|
||||
// 已退役列:充点商品固定「¥1 = 10 泥点、无首充赠送」,不再从后台入参接收。
|
||||
bonus_points: 0,
|
||||
duration_days: 0,
|
||||
badge_label: validated_input.badge_label,
|
||||
description: validated_input.description,
|
||||
// 已退役列:不参与运行态,写固定默认值即可。
|
||||
|
||||
Reference in New Issue
Block a user