@@ -30,6 +30,7 @@ import { SettlementService } from '../settlement/settlement.service';
|
||||
import { BenefitService } from '../benefit/benefit.service';
|
||||
import { AuthService } from '../iam/auth.service';
|
||||
import { PayRedeemAnomalyService } from '../../common/alert/pay-redeem-anomaly.service';
|
||||
import { WecomMessagePushService } from '../../integrations/wecom/wecom-message-push.service';
|
||||
|
||||
type TokenPayload = {
|
||||
userId: string;
|
||||
@@ -82,6 +83,7 @@ export class RedeemService {
|
||||
private readonly analyticsService: AnalyticsService,
|
||||
private readonly authService: AuthService,
|
||||
private readonly payRedeemAnomaly: PayRedeemAnomalyService,
|
||||
private readonly wecomPush: WecomMessagePushService,
|
||||
) {}
|
||||
|
||||
private maskPhoneForStore(phone: string) {
|
||||
@@ -276,6 +278,22 @@ export class RedeemService {
|
||||
extraJson: redeemExtra,
|
||||
});
|
||||
|
||||
if (!isTest) {
|
||||
const channelLabel = redeemChannel === 'PHONE' ? '手机号' : '扫码';
|
||||
void this.wecomPush.dispatchEvent(
|
||||
'redeem.success',
|
||||
{
|
||||
redeemNo: record.redeemNo,
|
||||
amount: amountNum.toFixed(2),
|
||||
storeName: account.store.name || String(account.storeId),
|
||||
channel: channelLabel,
|
||||
},
|
||||
{
|
||||
handlePath: `/redeem-records?redeemNo=${encodeURIComponent(record.redeemNo)}`,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
...record,
|
||||
amount: amountNum,
|
||||
|
||||
Reference in New Issue
Block a user