From 44d59189a2e6c548b925105bf0a7c768c904feeb Mon Sep 17 00:00:00 2001 From: mlogclub Date: Wed, 29 Apr 2026 19:54:59 +0800 Subject: [PATCH] feat: add batch schedule frontend api --- web/lib/api/admin.ts | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/web/lib/api/admin.ts b/web/lib/api/admin.ts index 7c33657..2f992ee 100644 --- a/web/lib/api/admin.ts +++ b/web/lib/api/admin.ts @@ -525,6 +525,38 @@ export type UpdateAdminAgentTeamSchedulePayload = id: number } +export type BatchAdminAgentTeamSchedulePayload = { + teamIds: number[] + startDate: string + endDate: string + weekdays: number[] + startTime: string + endTime: string + remark: string +} + +export type AdminAgentTeamScheduleBatchPreviewItem = { + teamId: number + teamName: string + date: string + weekday: number + startAt: string + endAt: string + remark: string + conflict: boolean + conflictReason: string +} + +export type AdminAgentTeamScheduleBatchPreview = { + total: number + conflict: boolean + items: AdminAgentTeamScheduleBatchPreviewItem[] +} + +export type AdminAgentTeamScheduleBatchGenerateResult = { + created: number +} + function toQueryString(query?: Record) { if (!query) { return "" @@ -1123,6 +1155,26 @@ export function deleteAgentTeamSchedule(id: number) { }) } +export function previewAgentTeamScheduleBatch(payload: BatchAdminAgentTeamSchedulePayload) { + return request( + "/api/dashboard/agent-team-schedule/batch_preview", + { + method: "POST", + body: JSON.stringify(payload), + } + ) +} + +export function generateAgentTeamScheduleBatch(payload: BatchAdminAgentTeamSchedulePayload) { + return request( + "/api/dashboard/agent-team-schedule/batch_generate", + { + method: "POST", + body: JSON.stringify(payload), + } + ) +} + export type AIConfig = { id: number name: string