feat: add batch schedule frontend api

This commit is contained in:
mlogclub
2026-04-29 19:54:59 +08:00
parent a2ba3784fb
commit 44d59189a2
+52
View File
@@ -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<string, string | number | undefined>) {
if (!query) {
return ""
@@ -1123,6 +1155,26 @@ export function deleteAgentTeamSchedule(id: number) {
})
}
export function previewAgentTeamScheduleBatch(payload: BatchAdminAgentTeamSchedulePayload) {
return request<AdminAgentTeamScheduleBatchPreview>(
"/api/dashboard/agent-team-schedule/batch_preview",
{
method: "POST",
body: JSON.stringify(payload),
}
)
}
export function generateAgentTeamScheduleBatch(payload: BatchAdminAgentTeamSchedulePayload) {
return request<AdminAgentTeamScheduleBatchGenerateResult>(
"/api/dashboard/agent-team-schedule/batch_generate",
{
method: "POST",
body: JSON.stringify(payload),
}
)
}
export type AIConfig = {
id: number
name: string