feat: initial sketch with AI

This commit is contained in:
2026-08-21 17:09:32 +02:00
parent d3fe34cb22
commit 10aefdd655
40 changed files with 13491 additions and 459 deletions
+42 -7
View File
@@ -1,12 +1,47 @@
import Dexie from 'dexie';
import Dexie, { type Table } from 'dexie'
import type { List, ListItem } from '@/types/list'
export const db = new Dexie('dttmrdb')
export interface LocalList extends List {
pendingSync?: boolean
}
db.version(1).stores({
lists: '++id, uuid, title',
export interface LocalListItem extends ListItem {
pendingSync?: boolean
}
listItems: '++id, uuid, title, isChecked',
export type SyncOperationType =
| 'createList'
| 'createListItem'
| 'updateListItem'
| 'setListItemCompleted'
| 'addUserToList'
| 'removeUserFromList'
syncQueue: '++id, action, endpoint, createdAt',
})
export interface SyncQueueEntry {
id?: number
type: SyncOperationType
payload: unknown
localListId?: string
localListItemId?: string
createdAt: number
attempts: number
lastError?: string
}
class AppDatabase extends Dexie {
lists!: Table<LocalList, string>
listItems!: Table<LocalListItem, string>
syncQueue!: Table<SyncQueueEntry, number>
constructor() {
super('dttmrdb')
this.version(1).stores({
lists: 'id, name, pendingSync',
listItems: 'id, list_id, title, is_completed, pendingSync',
syncQueue: '++id, type, createdAt',
})
}
}
export const db = new AppDatabase()