fix(qr): inactive answer for malformed codes, undated events, switched-off badge, reset-pending sessions

A code of the wrong shape now shows "no longer active" instead of failing,
My QR codes skips events with no end date and marks switched-off codes,
and a session waiting on a password reset can still open a QR page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-12-01 14:04:12 +08:00
1 parent c6c220265f
commit d532bdcda4
10 files changed
+59 -6

No files matched your search

@@ -77,11 +77,11 @@ public class RegistrationLinkService {
.map(EventSalesperson::getEventUuid).toList();
if (uuids.isEmpty()) return List.of();
return eventRepository.findByCompanyIdAndUuidIn(req.companyId(), uuids).stream()
.filter(e -> e.getEnabled() == GeneralEnum.FlagYesNo.Y && !e.getDateEnd().toLocalDate().isBefore(today))
.sorted(Comparator.comparing(Event::getDateStart))
.filter(e -> e.getEnabled() == GeneralEnum.FlagYesNo.Y && e.getDateEnd() != null && !e.getDateEnd().toLocalDate().isBefore(today))
.sorted(Comparator.comparing(Event::getDateStart, Comparator.nullsLast(Comparator.naturalOrder())))
.map(e -> {
RegistrationLink l = personal(req.companyId(), e.getUuid(), req.userId());
return new MineRow(String.valueOf(e.getUuid()), e.getName(), e.getDateStart().toLocalDate().toString(),
return new MineRow(String.valueOf(e.getUuid()), e.getName(), e.getDateStart() == null ? null : e.getDateStart().toLocalDate().toString(),
e.getDateEnd().toLocalDate().toString(), e.getLocation(), l.getToken(), l.isEnabled());
}).toList();
}