import { cards, decks } from '../db/schema/index.ts'; export function toDeckDto(row: typeof decks.$inferSelect) { return { id: row.id, user_id: row.userId, name: row.name, description: row.description, color: row.color, category: row.category, visibility: row.visibility, fsrs_settings: row.fsrsSettings, content_hash: row.contentHash, forked_from_marketplace_deck_id: row.forkedFromMarketplaceDeckId, forked_from_marketplace_version_id: row.forkedFromMarketplaceVersionId, archived_at: row.archivedAt?.toISOString() ?? null, created_at: row.createdAt.toISOString(), updated_at: row.updatedAt.toISOString(), }; } export function toCardDto(row: typeof cards.$inferSelect) { return { id: row.id, deck_id: row.deckId, user_id: row.userId, type: row.type, fields: row.fields, content_hash: row.contentHash, created_at: row.createdAt.toISOString(), updated_at: row.updatedAt.toISOString(), }; }