fix(business-loop): complete arbitration balance refund, withdrawal rejection compensation, admin activity takedown, and companion violation alerts
这个提交包含在:
@@ -479,16 +479,18 @@ app.post('/api/activities/:id/adjust-price', async (req: Request, res: Response)
|
||||
}
|
||||
});
|
||||
|
||||
// 房主取消/解散组局并触发全额原路退款
|
||||
// 房主或平台管理员取消/违规下架组局并触发全额原路退款
|
||||
app.post('/api/activities/:id/cancel', async (req: Request, res: Response) => {
|
||||
try {
|
||||
const actId = String(req.params.id);
|
||||
const { hostId, reason } = req.body;
|
||||
const result = await repo.cancelActivity(actId, Number(hostId || 1001), reason);
|
||||
const { hostId, reason, operatorRole } = req.body || {};
|
||||
const headerRole = req.headers['x-user-role'];
|
||||
const isAdmin = operatorRole === 'admin' || headerRole === 'admin';
|
||||
const result = await repo.cancelActivity(actId, Number(hostId || 1001), reason, isAdmin);
|
||||
res.json({
|
||||
code: 20000,
|
||||
data: result,
|
||||
message: `组局已成功解散${result.refundedCount > 0 ? `,已原路全额退款 ${result.refundedCount} 位搭子` : ''}`
|
||||
message: `组局已成功解散下架${result.refundedCount > 0 ? `,已原路全额退款 ${result.refundedCount} 位搭子` : ''}`
|
||||
});
|
||||
} catch (err: any) {
|
||||
res.status(400).json({ code: 40000, message: err.message });
|
||||
|
||||
在新工单中引用
屏蔽一个用户