import { db } from '../db/schema'; import type { CuadreCaja } from '@toldo/core'; export class CuadreRepository { async create(cuadre: CuadreCaja): Promise { return db.cuadres.add(cuadre); } async getByFecha(fecha: Date): Promise { const start = new Date(fecha); start.setHours(0, 0, 0, 0); const end = new Date(fecha); end.setHours(23, 59, 59, 999); return db.cuadres.where('fecha').between(start, end).toArray(); } async getAll(): Promise { return db.cuadres.toArray(); } }