fix: split reading sessions based on the date (#2316)

Co-authored-by: WorldTeacher <coding_contact@pm.me>
This commit is contained in:
WorldTeacher
2026-01-17 23:07:58 -07:00
committed by GitHub
co-authored by WorldTeacher
parent 890d7cc230
commit acca38a404
@@ -40,7 +40,7 @@ public interface ReadingSessionRepository extends JpaRepository<ReadingSessionEn
JOIN rs.book b
WHERE rs.user.id = :userId
AND rs.startTime >= :startOfWeek AND rs.startTime < :endOfWeek
GROUP BY b.id, b.metadata.title, rs.bookType
GROUP BY b.id, b.metadata.title, rs.bookType, CAST(rs.startTime AS LocalDate)
ORDER BY MIN(rs.startTime)
""")
List<ReadingSessionTimelineDto> findSessionTimelineByUserAndWeek(