feat(M08-B): 补保洁统计明细

This commit is contained in:
Codex
2026-06-30 10:24:39 +08:00
parent f59beb0e75
commit e48d1f0301
15 changed files with 616 additions and 46 deletions
+44
View File
@@ -156,6 +156,40 @@ const app = await buildApp({
async stats(input) {
calls.push(['stats', input]);
return { byStatus: { SUBMITTED: 2 }, pendingSettlementCents: 1200 };
},
async managerStatistics(input) {
calls.push(['managerStatistics', input]);
return {
summary: {
taskTotal: 5,
pendingReview: 2,
active: 1,
rejected: 1,
completed: 1,
rewardCents: 3000,
pendingSettlementCents: 1200,
confirmedSettlementCents: 800,
paidSettlementCents: 600
},
byStatus: [{ status: 'SUBMITTED', total: 2, rewardCents: 1200 }],
byStore: [{
storeId: '11',
storeName: 'Test Store',
taskTotal: 5,
pendingReview: 2,
completed: 1,
rejected: 1,
rewardCents: 3000
}],
settlements: [{ status: 'CONFIRMED', total: 1, rewardCents: 800 }],
members: [{
cleanerUserId: '31',
cleanerName: 'Cleaner',
taskCount: 3,
pendingSettlementCents: 1200,
settledRewardCents: 600
}]
};
}
},
payoutService: {
@@ -248,6 +282,16 @@ assert.equal(manageList.statusCode, 200);
assert.equal(calls.at(-1)[0], 'listManage');
assert.equal(calls.at(-1)[1].status, 'SUBMITTED');
const managerStats = await app.inject({
method: 'GET',
url: '/admin-api/cleaning/statistics?from=2026-06-01&to=2026-07-01&storeId=11',
headers: { authorization: `Bearer ${token}` }
});
assert.equal(managerStats.statusCode, 200);
assert.equal(calls.at(-1)[0], 'managerStatistics');
assert.equal(calls.at(-1)[1].storeId, '11');
assert.equal(managerStats.json().data.summary.pendingSettlementCents, 1200);
const claim = await app.inject({
method: 'POST',
url: '/app-api/cleaning/tasks/101/claim',