fix(#240): remove readyCount from weekly stats DTO and SQL query
The Lesefertig pulse was removed from the UI; drop the backend support for it too — removes the subquery from findWeeklyStats(), the projection getter, the DTO field, and updates all affected tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,5 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
*/
|
||||
public record TranscriptionWeeklyStatsDTO(
|
||||
@Schema(requiredMode = Schema.RequiredMode.REQUIRED) long segmentationCount,
|
||||
@Schema(requiredMode = Schema.RequiredMode.REQUIRED) long transcriptionCount,
|
||||
@Schema(requiredMode = Schema.RequiredMode.REQUIRED) long readyCount
|
||||
@Schema(requiredMode = Schema.RequiredMode.REQUIRED) long transcriptionCount
|
||||
) {}
|
||||
|
||||
@@ -232,10 +232,7 @@ public interface DocumentRepository extends JpaRepository<Document, UUID>, JpaSp
|
||||
WHERE da.created_at >= NOW() - INTERVAL '7 days') AS segmentationCount,
|
||||
(SELECT COUNT(DISTINCT tb.document_id) FROM transcription_blocks tb
|
||||
WHERE tb.created_at >= NOW() - INTERVAL '7 days'
|
||||
AND tb.text IS NOT NULL AND tb.text <> '') AS transcriptionCount,
|
||||
(SELECT COUNT(DISTINCT tb.document_id) FROM transcription_blocks tb
|
||||
WHERE tb.updated_at >= NOW() - INTERVAL '7 days'
|
||||
AND tb.reviewed = true) AS readyCount
|
||||
AND tb.text IS NOT NULL AND tb.text <> '') AS transcriptionCount
|
||||
""")
|
||||
TranscriptionWeeklyStatsProjection findWeeklyStats();
|
||||
|
||||
|
||||
@@ -7,5 +7,4 @@ package org.raddatz.familienarchiv.repository;
|
||||
public interface TranscriptionWeeklyStatsProjection {
|
||||
long getSegmentationCount();
|
||||
long getTranscriptionCount();
|
||||
long getReadyCount();
|
||||
}
|
||||
|
||||
@@ -46,8 +46,7 @@ public class TranscriptionQueueService {
|
||||
var stats = documentRepository.findWeeklyStats();
|
||||
return new TranscriptionWeeklyStatsDTO(
|
||||
stats.getSegmentationCount(),
|
||||
stats.getTranscriptionCount(),
|
||||
stats.getReadyCount()
|
||||
stats.getTranscriptionCount()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user