Update scheduling parameters and refactor channel endpoints: extend HorizonDays to 7 and RetentionDays to 90 in appsettings.json. Consolidate channel-related endpoint logic by removing obsolete files and enhancing the ShowEndpoints with audience and genre management capabilities. Improve error handling and streamline command handlers for channel operations.
build / backend (push) Successful in 7m40s
build / frontend (push) Failing after 39s
tests / backend-tests (push) Successful in 6m9s

This commit is contained in:
Leonid Pershin
2026-07-26 13:32:13 +03:00
parent c4ef954dea
commit 66040a8841
272 changed files with 27944 additions and 8699 deletions
+69
View File
@@ -0,0 +1,69 @@
import { apiRequest } from '@/shared/api/client'
import type {
CreatedIdResponse,
GroupCandidateDto,
GroupDto,
GroupElementKind,
GroupFilter,
GroupSummaryDto,
} from '@/shared/api/types'
export function listGroups() {
return apiRequest<GroupSummaryDto[]>('/admin/groups')
}
export function getGroup(id: string) {
return apiRequest<GroupDto>(`/admin/groups/${id}`)
}
export function createGroup(body: { name: string; description?: string }) {
return apiRequest<CreatedIdResponse>('/admin/groups', { method: 'POST', body })
}
export function updateGroup(
id: string,
body: { name: string; description: string | null; filter: GroupFilter | null },
) {
return apiRequest<void>(`/admin/groups/${id}`, { method: 'PUT', body })
}
export function deleteGroup(id: string) {
return apiRequest<void>(`/admin/groups/${id}`, { method: 'DELETE' })
}
/** Подбор по правилу набора. Фильтр передаётся явно — редактор крутит его до сохранения. */
export function findGroupCandidates(id: string, filter: GroupFilter | null) {
return apiRequest<GroupCandidateDto[]>(`/admin/groups/${id}/candidates`, {
method: 'POST',
body: { filter },
})
}
export function addGroupElements(
id: string,
elements: { elementKind: GroupElementKind; elementId: string }[],
) {
return apiRequest<{ added: number }>(`/admin/groups/${id}/items`, {
method: 'POST',
body: { elements },
})
}
export function removeGroupItem(id: string, itemId: string) {
return apiRequest<void>(`/admin/groups/${id}/items/${itemId}`, { method: 'DELETE' })
}
export function setGroupItemWeight(id: string, itemId: string, weight: number) {
return apiRequest<void>(`/admin/groups/${id}/items/${itemId}/weight`, {
method: 'PUT',
body: { weight },
})
}
/** Порядок позиций: не упомянутые остаются после перечисленных. */
export function reorderGroup(id: string, itemIdsInOrder: string[]) {
return apiRequest<void>(`/admin/groups/${id}/order`, {
method: 'PUT',
body: { itemIdsInOrder },
})
}