@@ -20,6 +20,8 @@ import type {
|
||||
} from './dto/admin-mutate.dto';
|
||||
import { TestWhitelistService } from '../../common/test-whitelist/test-whitelist.service';
|
||||
import { HqPermissionsResolver, hqStoreCityWhere, mergeHqStoreCityWhere, type HqCityScope } from '../../common/guards/hq-permission.guard';
|
||||
import { WecomMessagePushService } from '../../integrations/wecom/wecom-message-push.service';
|
||||
import { formatHqWecomLabel, formatPartnerWecomLabel } from '../store/wecom-submitter-label';
|
||||
|
||||
/** 选填文案:空 / null / "null" 一律存库为 null,避免 String(null)==="null" */
|
||||
function normalizeStoreOptionalText(value: unknown): string | null {
|
||||
@@ -56,6 +58,7 @@ export class AdminStoresService {
|
||||
private readonly analyticsService: AnalyticsService,
|
||||
private readonly testWhitelist: TestWhitelistService,
|
||||
private readonly hqPermissions: HqPermissionsResolver,
|
||||
private readonly wecomPush: WecomMessagePushService,
|
||||
) {}
|
||||
|
||||
private async storeIdsInScope(scope: HqCityScope): Promise<bigint[] | null> {
|
||||
@@ -776,6 +779,23 @@ export class AdminStoresService {
|
||||
});
|
||||
}
|
||||
|
||||
const [submitter, partnerLabel] = await Promise.all([
|
||||
formatHqWecomLabel(this.prisma, actorId),
|
||||
formatPartnerWecomLabel(this.prisma, partnerAccountId),
|
||||
]);
|
||||
void this.wecomPush.dispatchEvent(
|
||||
'store.audit_pending',
|
||||
{
|
||||
storeName: store.name,
|
||||
cityName: store.cityName,
|
||||
submitter,
|
||||
partnerLabel,
|
||||
action: '新建',
|
||||
storeId: store.id.toString(),
|
||||
},
|
||||
{ handlePath: `/stores?storeId=${store.id.toString()}` },
|
||||
);
|
||||
|
||||
return this.detailStore(store.id, actorId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user