feat(closed-loop): complete end-to-end closed loops across miniapp, backend, and admin
这个提交包含在:
@@ -372,6 +372,88 @@ describe('ClientFeatures (TDD 测试套件: 用户端功能闭环)', () => {
|
||||
expect(content).toContain('/api/post-applies/');
|
||||
});
|
||||
});
|
||||
|
||||
describe('10. 全链路跨端业务闭环深度校验 (实名审核回流/完单结算+二级返佣/争议结案/搭子审批/举报反馈/大神ID双向解析)', () => {
|
||||
it('大神认证申请与个人中心必须实时同步后端 certStatus 与 rejectReason,支持驳回后查看原因并重新提审', () => {
|
||||
const applyVuePath = path.join(uniPagesDir, 'expert', 'apply.vue');
|
||||
const applyContent = fs.readFileSync(applyVuePath, 'utf-8');
|
||||
expect(applyContent).toContain('syncRemoteCertStatus');
|
||||
expect(applyContent).toContain('rejectReason');
|
||||
|
||||
const userIndexPath = path.join(uniPagesDir, 'user', 'index.vue');
|
||||
const userContent = fs.readFileSync(userIndexPath, 'utf-8');
|
||||
expect(userContent).toContain('setExpertCertStatus');
|
||||
expect(userContent).toContain('rejectReason');
|
||||
});
|
||||
|
||||
it('订单确认完成或评价时,后端必须触发 completeOrderWithSettlement 自动结算大神佣金与一二级分销返佣', () => {
|
||||
const repoPath = path.join(serverSrcDir, 'db', 'repository.ts');
|
||||
const content = fs.readFileSync(repoPath, 'utf-8');
|
||||
|
||||
expect(content).toContain('completeOrderWithSettlement');
|
||||
expect(content).toContain('大神完单收益结算');
|
||||
expect(content).toContain('INSERT INTO distribution_records');
|
||||
});
|
||||
|
||||
it('争议仲裁驳回退款或扣信用分时,必须同步将关联订单从争议仲裁中流转为已完成并触发结算', () => {
|
||||
const repoPath = path.join(serverSrcDir, 'db', 'repository.ts');
|
||||
const content = fs.readFileSync(repoPath, 'utf-8');
|
||||
|
||||
expect(content).toContain('handleArbitration');
|
||||
expect(content).toContain("SET status = '已完成'");
|
||||
expect(content).toContain('this.completeOrderWithSettlement(shouldSettleOrderId)');
|
||||
});
|
||||
|
||||
it('友圈动态必须返回搭子上车申请状态 myApplyStatus,且小程序端支持房主直接审批申请与申请人查看状态', () => {
|
||||
const communityVuePath = path.join(uniPagesDir, 'community', 'index.vue');
|
||||
const content = fs.readFileSync(communityVuePath, 'utf-8');
|
||||
|
||||
expect(content).toContain('handleManageApplies');
|
||||
expect(content).toContain('getPostApplies');
|
||||
expect(content).toContain('handlePostApply');
|
||||
expect(content).toContain('myApplyStatus');
|
||||
});
|
||||
|
||||
it('用户提交举报投诉后,个人中心必须提供“我的举报与维权反馈”查询入口,且管理后台工作台联动待办提醒', () => {
|
||||
const userIndexPath = path.join(uniPagesDir, 'user', 'index.vue');
|
||||
const userContent = fs.readFileSync(userIndexPath, 'utf-8');
|
||||
expect(userContent).toContain('openMyReportsModal');
|
||||
expect(userContent).toContain('getMyReports');
|
||||
expect(userContent).toContain('我的举报与维权反馈');
|
||||
|
||||
const todoListPath = path.join(rootDir, 'admin', 'arco-design-pro-vite', 'src', 'views', 'dashboard', 'workplace', 'components', 'quick-todo-list.vue');
|
||||
const todoContent = fs.readFileSync(todoListPath, 'utf-8');
|
||||
expect(todoContent).toContain('pendingReports');
|
||||
expect(todoContent).toContain('/safety/reports');
|
||||
});
|
||||
|
||||
it('分销推广中心必须支持绑定上级邀请码 (POST /api/distribution/bind) 并实时汇总下级贡献佣金', () => {
|
||||
const indexPath = path.join(serverSrcDir, 'index.ts');
|
||||
const indexContent = fs.readFileSync(indexPath, 'utf-8');
|
||||
expect(indexContent).toContain("app.post('/api/distribution/bind'");
|
||||
|
||||
const promoteVuePath = path.join(uniPagesDir, 'user', 'promote.vue');
|
||||
const promoteContent = fs.readFileSync(promoteVuePath, 'utf-8');
|
||||
expect(promoteContent).toContain('handleBindInviteCode');
|
||||
expect(promoteContent).toContain('bindInviteCode');
|
||||
});
|
||||
|
||||
it('大神 ID 必须支持 1..6 与 101..106 双向解析 (resolveCompanionRow),确保收藏列表、评价、资料修改与在线状态切换全链路一致', () => {
|
||||
const repoPath = path.join(serverSrcDir, 'db', 'repository.ts');
|
||||
const content = fs.readFileSync(repoPath, 'utf-8');
|
||||
expect(content).toContain('resolveCompanionRow');
|
||||
|
||||
const hallVuePath = path.join(uniPagesDir, 'expert', 'hall.vue');
|
||||
const hallContent = fs.readFileSync(hallVuePath, 'utf-8');
|
||||
expect(hallContent).toContain('updateCompanionProfile');
|
||||
|
||||
const workspaceVuePath = path.join(uniPagesDir, 'expert', 'workspace.vue');
|
||||
const wsContent = fs.readFileSync(workspaceVuePath, 'utf-8');
|
||||
expect(wsContent).toContain('updateCompanionProfile');
|
||||
expect(wsContent).toContain('completeOrderApi');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户