aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/server/routes/cards.test.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-31 00:53:48 +0900
committernsfisis <nsfisis@gmail.com>2025-12-31 00:53:48 +0900
commitc77da463a60061877cd7ddea1bd7b723b3bf2455 (patch)
tree48227c1a66403a6729213aceb510bd4c699ee494 /src/server/routes/cards.test.ts
parenta6156762ee77bf4bdf7085ff912dd325b45658f0 (diff)
downloadkioku-c77da463a60061877cd7ddea1bd7b723b3bf2455.tar.gz
kioku-c77da463a60061877cd7ddea1bd7b723b3bf2455.tar.zst
kioku-c77da463a60061877cd7ddea1bd7b723b3bf2455.zip
feat(repo): extend CardRepository with note data support
Add noteId and isReversed fields to Card interface for note-based cards. Implement findByIdWithNoteData, findByNoteId, and softDeleteByNoteId methods to support fetching cards with their associated note data and cascading deletions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/server/routes/cards.test.ts')
-rw-r--r--src/server/routes/cards.test.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/routes/cards.test.ts b/src/server/routes/cards.test.ts
index d319b33..129efa6 100644
--- a/src/server/routes/cards.test.ts
+++ b/src/server/routes/cards.test.ts
@@ -15,9 +15,12 @@ function createMockCardRepo(): CardRepository {
return {
findByDeckId: vi.fn(),
findById: vi.fn(),
+ findByIdWithNoteData: vi.fn(),
+ findByNoteId: vi.fn(),
create: vi.fn(),
update: vi.fn(),
softDelete: vi.fn(),
+ softDeleteByNoteId: vi.fn(),
findDueCards: vi.fn(),
updateFSRSFields: vi.fn(),
};
@@ -66,6 +69,8 @@ function createMockCard(overrides: Partial<Card> = {}): Card {
return {
id: "card-uuid-123",
deckId: "deck-uuid-123",
+ noteId: null,
+ isReversed: null,
front: "Question",
back: "Answer",
state: CardState.New,