diff options
| author | Claude <noreply@anthropic.com> | 2026-02-12 14:54:18 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-02-12 14:54:18 +0000 |
| commit | 1afb825860cd293b8065d51746f4b23e4e8dab5d (patch) | |
| tree | 1fe3a43f1c7ab469bb0154a1495028cc42b414a0 /src/server/repositories/review-log.ts | |
| parent | 9a52e7ad3b2d46c523caf079794fdb7757375b91 (diff) | |
| download | kioku-1afb825860cd293b8065d51746f4b23e4e8dab5d.tar.gz kioku-1afb825860cd293b8065d51746f4b23e4e8dab5d.tar.zst kioku-1afb825860cd293b8065d51746f4b23e4e8dab5d.zip | |
feat: 学習カード数の上限を撤廃
REVIEW_CARDS_LIMIT(復習カード80枚制限)とnewCardsPerDay(1日の新規カード制限)
を削除し、期日が来たすべてのカードを制限なく返すように変更。
削除した主な要素:
- REVIEW_CARDS_LIMIT定数とカード取得時のlimitパラメータ
- newCardsPerDayフィールド(DB schema, 型定義, Zod schema, sync, CRDT)
- countDueNewCards, countDueReviewCards, findDueNewCardsForStudy,
findDueReviewCardsForStudy(CardRepository)
- countTodayNewCardReviews(ReviewLogRepository)
- デッキルートからのReviewLogRepository依存
https://claude.ai/code/session_018hrEJ9vg3RPoeAPyEc17gS
Diffstat (limited to 'src/server/repositories/review-log.ts')
| -rw-r--r-- | src/server/repositories/review-log.ts | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/server/repositories/review-log.ts b/src/server/repositories/review-log.ts index 97488d2..c8950d6 100644 --- a/src/server/repositories/review-log.ts +++ b/src/server/repositories/review-log.ts @@ -1,7 +1,5 @@ -import { and, eq, gte, sql } from "drizzle-orm"; -import { getStartOfStudyDayBoundary } from "../../shared/date.js"; import { db } from "../db/index.js"; -import { CardState, cards, reviewLogs } from "../db/schema.js"; +import { reviewLogs } from "../db/schema.js"; import type { ReviewLog, ReviewLogRepository } from "./types.js"; export const reviewLogRepository: ReviewLogRepository = { @@ -31,21 +29,4 @@ export const reviewLogRepository: ReviewLogRepository = { } return reviewLog; }, - - async countTodayNewCardReviews(deckId: string, now: Date): Promise<number> { - const startOfDay = getStartOfStudyDayBoundary(now); - - const result = await db - .select({ count: sql<number>`count(distinct ${reviewLogs.cardId})::int` }) - .from(reviewLogs) - .innerJoin(cards, eq(reviewLogs.cardId, cards.id)) - .where( - and( - eq(cards.deckId, deckId), - eq(reviewLogs.state, CardState.New), - gte(reviewLogs.reviewedAt, startOfDay), - ), - ); - return result[0]?.count ?? 0; - }, }; |
