aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/db/repositories.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-31 01:29:39 +0900
committernsfisis <nsfisis@gmail.com>2025-12-31 01:29:39 +0900
commitc1d24e24449808e4235fa586fbeb5760a36bc6bb (patch)
treefb829349a2a6b33b5cf63f52d089efac24e1ec7b /src/client/db/repositories.ts
parent264c64090070dc87c4b61077934929e80d4d0142 (diff)
downloadkioku-c1d24e24449808e4235fa586fbeb5760a36bc6bb.tar.gz
kioku-c1d24e24449808e4235fa586fbeb5760a36bc6bb.tar.zst
kioku-c1d24e24449808e4235fa586fbeb5760a36bc6bb.zip
feat(client): add note-related tables to client IndexedDB
Add LocalNoteType, LocalNoteFieldType, LocalNote, and LocalNoteFieldValue interfaces and tables to the client database for Anki-compatible note system. Update LocalCard interface with noteId and isReversed fields. Includes Dexie schema version 2 with upgrade handler for existing cards. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src/client/db/repositories.ts')
-rw-r--r--src/client/db/repositories.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/db/repositories.ts b/src/client/db/repositories.ts
index 1a03f93..a2f0b41 100644
--- a/src/client/db/repositories.ts
+++ b/src/client/db/repositories.ts
@@ -171,6 +171,8 @@ export const localCardRepository = {
data: Omit<
LocalCard,
| "id"
+ | "noteId"
+ | "isReversed"
| "state"
| "due"
| "stability"
@@ -185,11 +187,14 @@ export const localCardRepository = {
| "deletedAt"
| "syncVersion"
| "_synced"
- >,
+ > &
+ Partial<Pick<LocalCard, "noteId" | "isReversed">>,
): Promise<LocalCard> {
const now = new Date();
const card: LocalCard = {
id: uuidv4(),
+ noteId: null,
+ isReversed: null,
...data,
state: CardState.New,
due: now,