fix: края архива, истории, пагинации и лимита попыток

This commit is contained in:
2026-10-29 21:05:44 +03:00
parent 82394cc688
commit a42bc64193
6 changed files with 14 additions and 9 deletions

View File

@@ -290,7 +290,7 @@ class GroupService(
MembershipHistoryRow(
id = event.id.toString(),
studentId = event.studentId.toString(),
studentName = studentsById[event.studentId]?.fullName.orEmpty(),
studentName = studentsById[event.studentId]?.fullName?.takeIf { it.isNotBlank() } ?: event.studentId.toString(),
fromGroupId = event.fromGroupId?.toString(),
fromGroupName = event.fromGroupId?.let { groupsById[it]?.name },
toGroupId = event.toGroupId?.toString(),
@@ -306,8 +306,8 @@ class GroupService(
@Transactional
fun restoreGroup(groupId: UUID): GroupDetail {
val group = groups.findById(groupId).orElseThrow { NotFoundException("Группа не найдена") }
if (group.status == GroupStatus.ACTIVE) {
throw BadRequestException("Группа ${group.name} уже активна")
if (group.status != GroupStatus.ARCHIVED) {
throw BadRequestException("Группа ${group.name} не находится в архиве")
}
group.status = GroupStatus.ACTIVE
groups.save(group)