From 95bb8c70a98fabae2a60b251489a59065b2978d1 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sun, 15 Feb 2026 17:09:51 +0900
Subject: fix(types): use CardStateType instead of number for card state fields

Card and StudyCard interfaces used generic number for state, causing
type errors when indexing Record<CardStateType, ...> maps. Also adds
missing FSRS fields to client Card interface to match API response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---
 src/client/pages/DeckDetailPage.test.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/client/pages/DeckDetailPage.test.tsx')

diff --git a/src/client/pages/DeckDetailPage.test.tsx b/src/client/pages/DeckDetailPage.test.tsx
index 0b9216b..b2fa7f0 100644
--- a/src/client/pages/DeckDetailPage.test.tsx
+++ b/src/client/pages/DeckDetailPage.test.tsx
@@ -9,6 +9,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
 import { Route, Router } from "wouter";
 import { memoryLocation } from "wouter/memory-location";
 import { authLoadingAtom, type Card, type Deck } from "../atoms";
+import { CardState } from "../db";
 import { DeckDetailPage } from "./DeckDetailPage";
 
 const mockDeckGet = vi.fn();
@@ -73,7 +74,7 @@ const mockCards = [
 		isReversed: false,
 		front: "Hello",
 		back: "こんにちは",
-		state: 0,
+		state: CardState.New,
 		due: "2099-01-01T00:00:00Z", // Not due yet (future date)
 		stability: 0,
 		difficulty: 0,
@@ -94,7 +95,7 @@ const mockCards = [
 		isReversed: false,
 		front: "Goodbye",
 		back: "さようなら",
-		state: 2,
+		state: CardState.Review,
 		due: new Date().toISOString(), // Due now
 		stability: 5.5,
 		difficulty: 5.0,
-- 
cgit v1.3-1-g0d28

