R50 通知推送:dispatcher 投递服务、业务事件接入与员工推送开关

这个提交包含在:
2026-04-05 11:21:39 +08:00
父节点 ff0a677bf3
当前提交 47e10e6acc
共修改 24 个文件,包含 1701 行新增和 197 行删除
+44
查看文件
@@ -85,6 +85,28 @@ export type NotificationChannelTestResponse = {
};
};
export type NotificationDeliveryStatus = "pending" | "success" | "failed";
export type NotificationDeliveryRecord = {
notificationId: string;
channelId: string;
channelName: string;
channelType: NotificationChannelType;
notificationType: string;
notificationTitle: string;
status: NotificationDeliveryStatus;
attemptCount: number;
latestAttemptAt: string | null;
resultCode: string | null;
errorMessage: string | null;
responseBody: unknown;
notificationCreatedAt: string | null;
};
export type NotificationDeliveryListResponse = {
items: NotificationDeliveryRecord[];
};
export async function fetchNotificationChannels() {
return apiRequestData<NotificationChannelListResponse>("/api/notifications/channels");
}
@@ -109,3 +131,25 @@ export async function testNotificationChannel(id: string) {
body: JSON.stringify({}),
});
}
export async function fetchNotificationDeliveries(filters: {
notificationId?: string | null;
channelId?: string | null;
status?: NotificationDeliveryStatus | "" | null;
}) {
const params = new URLSearchParams();
if (filters.notificationId) {
params.set("notificationId", filters.notificationId);
}
if (filters.channelId) {
params.set("channelId", filters.channelId);
}
if (filters.status) {
params.set("status", filters.status);
}
const queryString = params.toString();
return apiRequestData<NotificationDeliveryListResponse>(
`/api/notifications/deliveries${queryString ? `?${queryString}` : ""}`,
);
}