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