fix: 각을 시간대와 관계없이 활성화하고 시간 적합도를 가중치로 반영

This commit is contained in:
skkim committed 2026-10-22 13:38:39 +09:00
1 parent 3b5afba8a1
commit 799a46f53c
13 files changed
+124 -66

No files matched your search

+3 -2
View File
@@ -35,9 +35,10 @@ class IndexCRUD:
return await s.scalar(stmt)
async def has_unslotted(self, s: AsyncSession, region_code: str, day: date) -> bool:
"""그날 행 중 구간 점수가 비어 있는 행(구간 계산 전 행)이 있는지."""
"""현재 방식으로 모든 구간을 계산하지 않은 행이 있는지."""
stmt = select(IndexScore.index_id).where(
IndexScore.region_code == region_code, IndexScore.score_date == day, text("index_score.slots = '{}'::jsonb")
IndexScore.region_code == region_code, IndexScore.score_date == day,
text("NOT (index_score.slots ?& ARRAY['morning', 'day', 'evening', 'night', 'early'])")
).limit(1)
return (await s.scalar(stmt)) is not None