重构(会员契约): 会员结构体改用 ts-rs 生成类型

- shared-contracts 为 10 个会员结构体补 ts_rs::TS / ts(export),64 位整数字段补 ts(type = "number") 对齐前端 number
- 新增 10 个生成绑定;packages/shared 与 admin-web 改为 re-export 生成类型,仅 kind / status 等前端收窄联合用 Omit 组合保留
- 同步设计文档 §2.5 与决策日志
This commit is contained in:
2026-10-05 15:51:07 +08:00
parent 0930e402be
commit bc3e36ff33
15 changed files with 332 additions and 120 deletions
+7 -32
View File
@@ -2,6 +2,7 @@ import type {
ProfileMembershipCycleKind,
ProfileMembershipModelAccess,
ProfileMembershipPlan,
ProfileMembershipPlanResponse,
ProfileMembershipStatus,
} from '@genarrative/shared';
@@ -784,39 +785,13 @@ export interface ProfileRechargeProductConfigAdminListResponse {
entries: ProfileRechargeProductConfigAdminResponse[];
}
/** 会员档位目录行;后端 `profile_membership_plan` 表是价格与权益的唯一真相源。 */
export interface ProfileMembershipPlanAdminResponse {
plan: ProfileMembershipPlan;
title: string;
rank: number;
monthPriceCents: number;
yearPriceCents: number;
periodPoints: number;
modelAccess: ProfileMembershipModelAccess;
/** 并发上限;`128` 表示不设上限。 */
concurrentJobLimit: number;
/** 是否不设并发上限;由后端按哨兵值派生,前端不再自己比较 `128`。 */
unlimitedConcurrency: boolean;
enabled: boolean;
}
/** 会员档位目录行;直接复用 `@genarrative/shared` 的后端生成类型,避免手工漂移。 */
export type ProfileMembershipPlanAdminResponse = ProfileMembershipPlanResponse;
export interface ProfileMembershipPlanAdminListResponse {
entries: ProfileMembershipPlanAdminResponse[];
/** 并发哨兵阈值:`concurrentJobLimit >= 该值` 即不设上限;由后端下发,前端不硬编码。 */
unlimitedConcurrencyThreshold: number;
}
/** 后台按档位改价 / 改权益;`rank` 不在请求里,升级比较基准由代码内目录决定。 */
export interface AdminUpsertProfileMembershipPlanRequest {
plan: ProfileMembershipPlan;
title: string;
monthPriceCents: number;
yearPriceCents: number;
periodPoints: number;
modelAccess: ProfileMembershipModelAccess;
concurrentJobLimit: number;
enabled: boolean;
}
export type {
AdminUpsertProfileMembershipPlanRequest,
ProfileMembershipPlanAdminListResponse,
} from '@genarrative/shared';
export interface ProfileWalletConfigAdminResponse {
configId: string;