feat(expert): full closure of expert revenue trends, multichannel withdrawals, service manage, review reply and post manage
这个提交包含在:
@@ -578,6 +578,103 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
|
||||
expect(emojiRegex.test(content)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('14. 大神端经营与财务提现闭环规格验证 (2.2 陪玩端规格全套落地)', () => {
|
||||
it('服务端路由必须提供收益多维走势统计接口且按日/周/月返回指标数据', () => {
|
||||
const serverIndexPath = path.join(rootDir, 'server', 'src', 'index.ts');
|
||||
const content = fs.readFileSync(serverIndexPath, 'utf-8');
|
||||
expect(content).toContain("app.get('/api/expert/stats/:id/trends'");
|
||||
expect(content).toContain('getExpertRevenueTrends');
|
||||
|
||||
const repoPath = path.join(rootDir, 'server', 'src', 'db', 'repository.ts');
|
||||
const repoContent = fs.readFileSync(repoPath, 'utf-8');
|
||||
expect(repoContent).toContain('getExpertRevenueTrends');
|
||||
expect(repoContent).toContain('daily');
|
||||
expect(repoContent).toContain('weekly');
|
||||
expect(repoContent).toContain('monthly');
|
||||
});
|
||||
|
||||
it('服务端必须支持微信零钱、支付宝、银行卡多渠道提现并记录完整审批流', () => {
|
||||
const repoPath = path.join(rootDir, 'server', 'src', 'db', 'repository.ts');
|
||||
const repoContent = fs.readFileSync(repoPath, 'utf-8');
|
||||
expect(repoContent).toContain('withdrawUserCommission');
|
||||
expect(repoContent).toContain('getUserWithdrawals');
|
||||
expect(repoContent).toContain('WECHAT');
|
||||
expect(repoContent).toContain('ALIPAY');
|
||||
expect(repoContent).toContain('BANK');
|
||||
|
||||
const serverIndexPath = path.join(rootDir, 'server', 'src', 'index.ts');
|
||||
const serverContent = fs.readFileSync(serverIndexPath, 'utf-8');
|
||||
expect(serverContent).toContain("app.get('/api/users/:id/withdrawals'");
|
||||
});
|
||||
|
||||
it('服务端必须提供评价感谢回复、动态删除、服务状态切换接口', () => {
|
||||
const serverIndexPath = path.join(rootDir, 'server', 'src', 'index.ts');
|
||||
const serverContent = fs.readFileSync(serverIndexPath, 'utf-8');
|
||||
expect(serverContent).toContain("app.post('/api/reviews/:id/reply'");
|
||||
expect(serverContent).toContain("app.delete('/api/posts/:id'");
|
||||
expect(serverContent).toContain("app.put('/api/companions/:id/services/:serviceId/status'");
|
||||
});
|
||||
|
||||
it('前端工作台 (workspace.vue) 必须集成收益走势图表、服务管理与提现审批看板', () => {
|
||||
const wsPath = path.join(rootDir, 'pwuniapp', 'pages', 'expert', 'workspace.vue');
|
||||
const wsContent = fs.readFileSync(wsPath, 'utf-8');
|
||||
expect(wsContent).toContain('收益走势统计分析');
|
||||
expect(wsContent).toContain('getExpertRevenueTrends');
|
||||
expect(wsContent).toContain('trendPeriod');
|
||||
expect(wsContent).toContain('trendMetric');
|
||||
expect(wsContent).toContain('expertServices');
|
||||
expect(wsContent).toContain('updateExpertServiceStatus');
|
||||
expect(wsContent).toContain('showWithdrawRecordsModal');
|
||||
});
|
||||
|
||||
it('前端用户中心 (user/index.vue) 必须支持多渠道提现与提现记录看板', () => {
|
||||
const userPath = path.join(rootDir, 'pwuniapp', 'pages', 'user', 'index.vue');
|
||||
const userContent = fs.readFileSync(userPath, 'utf-8');
|
||||
expect(userContent).toContain('openWithdrawModal');
|
||||
expect(userContent).toContain('openWithdrawRecordsModal');
|
||||
expect(userContent).toContain('showWithdrawModal');
|
||||
expect(userContent).toContain('showWithdrawRecordsModal');
|
||||
expect(userContent).toContain('withdrawForm');
|
||||
});
|
||||
|
||||
it('前端动态广场与大神主页必须分别提供本人动态删除与评价回复感谢老板', () => {
|
||||
const commPath = path.join(rootDir, 'pwuniapp', 'pages', 'community', 'index.vue');
|
||||
const commContent = fs.readFileSync(commPath, 'utf-8');
|
||||
expect(commContent).toContain('deletePost');
|
||||
expect(commContent).toContain('isPostOwner');
|
||||
expect(commContent).toContain('handleDeletePost');
|
||||
|
||||
const detailPath = path.join(rootDir, 'pwuniapp', 'pages', 'expert', 'detail.vue');
|
||||
const detailContent = fs.readFileSync(detailPath, 'utf-8');
|
||||
expect(detailContent).toContain('replyOrderReview');
|
||||
expect(detailContent).toContain('expert-reply-bubble');
|
||||
expect(detailContent).toContain('handleReplyReview');
|
||||
});
|
||||
|
||||
it('全量新增业务代码严禁出现 Emoji 与微信 showModal 超过 4 汉字违规', () => {
|
||||
const emojiRegex = /(?:\p{Extended_Pictographic}|\p{Emoji_Presentation}|[\u2600-\u27BF])/u;
|
||||
const targetFiles = [
|
||||
path.join(rootDir, 'pwuniapp', 'pages', 'expert', 'workspace.vue'),
|
||||
path.join(rootDir, 'pwuniapp', 'pages', 'user', 'index.vue'),
|
||||
path.join(rootDir, 'pwuniapp', 'pages', 'community', 'index.vue'),
|
||||
path.join(rootDir, 'pwuniapp', 'pages', 'expert', 'detail.vue')
|
||||
];
|
||||
|
||||
targetFiles.forEach((file) => {
|
||||
const text = fs.readFileSync(file, 'utf-8');
|
||||
expect(emojiRegex.test(text)).toBe(false);
|
||||
|
||||
// 检查 confirmText 与 cancelText 不得超过 4 个字符
|
||||
const modalMatches = text.matchAll(/(?:confirmText|cancelText):\s*['"]([^'"]+)['"]/g);
|
||||
for (const match of modalMatches) {
|
||||
const btnText = match[1];
|
||||
expect(btnText.length).toBeLessThanOrEqual(4);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户