feat: pasar de la lista de espera a otro grupo del profesor

- `POST /groups/:gid/waitlist/:entryId/promote` acepta `targetGroupId`
  opcional (por defecto, el grupo en el que se anotó). El destino tiene que
  ser del mismo profesor; cupo y teléfono duplicado se validan ahí.
- Detalle de la lista de espera: selector "Asignar a" con los grupos llenos
  deshabilitados.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-11-02 15:39:55 -03:00
parent d397e9663c
commit fc12ec3ae0
7 changed files with 181 additions and 26 deletions

View File

@@ -319,9 +319,12 @@ export const updateGroupAttendee = (
export const getGroupWaitlist = (groupId: string, page = 1, pageSize = 100) =>
apiFetch<GroupWaitlistList>(`/api/v1/groups/${groupId}/waitlist?page=${page}&pageSize=${pageSize}`)
export const promoteGroupWaitlistEntry = (groupId: string, entryId: string) =>
// Sin `targetGroupId` la persona pasa al grupo en el que se anotó. El body va
// siempre: `apiFetch` manda Content-Type JSON y un body vacío no se parsea.
export const promoteGroupWaitlistEntry = (groupId: string, entryId: string, targetGroupId?: string) =>
apiFetch<PromoteGroupWaitlistEntryResult>(`/api/v1/groups/${groupId}/waitlist/${entryId}/promote`, {
method: 'POST',
body: JSON.stringify({ targetGroupId }),
})
export const removeGroupWaitlistEntry = (groupId: string, entryId: string) =>