feat(M08-C): 补会员检索与员工概况

This commit is contained in:
Codex
2026-08-10 10:35:44 +08:00
parent 8b46863cd8
commit 1b0839e881
22 changed files with 758 additions and 74 deletions
@@ -37,6 +37,7 @@ import { ThirdPartyClient } from '../dist/third-party/third-party-client.js';
import { ThirdPartyService } from '../dist/third-party/third-party-service.js';
import { DeviceRepository } from '../dist/devices/device-repository.js';
import { IotMessageService } from '../dist/devices/iot-message-service.js';
import { MemberProfileService } from '../dist/wallets/member-profile-service.js';
import {
executeMigrationPlan,
loadMigrationPlan,
@@ -708,6 +709,25 @@ async function assertPricingAndReservations(pool, context) {
assert.equal(managedAudit[0].action, 'ORDER_CREATED_ON_BEHALF');
assert.equal(String(JSON.parse(managedAudit[0].metadata).targetUserId), customerId);
const scopedMembers = await new MemberProfileService(pool).listMembers({
actor: {
tenantId: context.tenantId,
userId: adminId,
access: {
roles: ['STORE_ADMIN'],
capabilities: ['user.read'],
storeIds: [String(targetRows[0].storeId)]
}
},
page: 1,
pageSize: 20,
status: 'ACTIVE',
search: customerId
});
assert.equal(scopedMembers.total, 1);
assert.equal(scopedMembers.items[0].memberId, customerId);
assert.ok(scopedMembers.items[0].orders.orderCount >= 1);
const [foreignUser] = await pool.query(
`INSERT INTO qipai_users (tenant_id, user_type, status)
VALUES (?, 'CUSTOMER', 'ACTIVE')`,
@@ -2000,6 +2020,7 @@ try {
'store-scoped on-behalf booking rejection',
'manager on-behalf booking history and audit attribution',
'cross-tenant on-behalf target user rejection',
'store-scoped member discovery through historical owner orders',
'share token stored as SHA-256 only',
'default view and door permissions',
'renew permission denied by default',