将每日免费泥点纳入后台配置
Project CI / Repository checks (push) Successful in 1m0s
Project CI / Frontend tests (push) Successful in 2m57s
Project CI / Backend tests (push) Successful in 3m30s
Project CI / Native shell tests (push) Successful in 12m11s

在账号配置页一次维护初始泥点和每日免费额度
将每日额度贯穿钱包配置、日切重置与充值中心投影
补齐迁移兼容、生成绑定、测试和文档
This commit is contained in:
2026-07-31 13:04:27 +08:00
parent 0386a5df7c
commit 93ed7f2c57
22 changed files with 277 additions and 25 deletions
@@ -11,6 +11,7 @@ import {
updateAdminAccount,
uploadAdminEditorShowcaseCampaignImage,
upsertAdminFeatureGateConfig,
upsertProfileWalletConfig,
} from './adminApiClient';
afterEach(() => {
@@ -71,6 +72,33 @@ test('后台账号创建和更新同时携带 Tab 与独立操作权限', async
);
});
test('账号配置一次提交初始和每日免费泥点', async () => {
const fetchMock = vi.fn().mockResolvedValue(
new Response(JSON.stringify({configId: 'profile_wallet'}), {
status: 200,
headers: {'content-type': 'application/json'},
}),
);
vi.stubGlobal('fetch', fetchMock);
await upsertProfileWalletConfig('owner-token', {
initialMudPoints: 100,
dailyFreePointsPerDay: 35,
});
expect(fetchMock).toHaveBeenCalledWith(
'/admin/api/profile/wallet-config',
expect.objectContaining({
method: 'POST',
headers: expect.objectContaining({Authorization: 'Bearer owner-token'}),
body: JSON.stringify({
initialMudPoints: 100,
dailyFreePointsPerDay: 35,
}),
}),
);
});
test('灰度配置读写只使用通用 feature-gates 管理接口', async () => {
const fetchMock = vi.fn().mockImplementation(() =>
Promise.resolve(
+2
View File
@@ -560,6 +560,7 @@ export interface AdminUpsertProfileRechargeProductRequest {
export interface AdminUpsertProfileWalletConfigRequest {
initialMudPoints: number;
dailyFreePointsPerDay: number;
}
export interface ProfileRedeemCodeAdminResponse {
@@ -661,6 +662,7 @@ export interface ProfileRechargeProductConfigAdminListResponse {
export interface ProfileWalletConfigAdminResponse {
configId: string;
initialMudPoints: number;
dailyFreePointsPerDay: number;
createdBy: string;
createdByDisplayName: string;
createdAt: string;