feat: implementar jornadas y validar aliases

This commit is contained in:
mono
2026-10-25 17:20:48 -05:00
parent 89390b5bed
commit 4ffce3e3cd
27 changed files with 537 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
import Dexie, { type Table } from 'dexie';
import type { Productor, Producto, MovimientoInventario, Venta, VentaLinea, Gasto, Ajuste, CuadreCaja } from '@toldo/core';
import type { Productor, Producto, MovimientoInventario, Venta, VentaLinea, Gasto, Ajuste, CuadreCaja, JornadaToldo } from '@toldo/core';
export class ToldoDB extends Dexie {
productores!: Table<Productor, string>;
@@ -10,6 +10,7 @@ export class ToldoDB extends Dexie {
gastos!: Table<Gasto, string>;
ajustes!: Table<Ajuste, string>;
cuadres!: Table<CuadreCaja, string>;
jornadas!: Table<JornadaToldo, string>;
constructor() {
super('ToldoConjuntoDB');
@@ -23,6 +24,17 @@ export class ToldoDB extends Dexie {
ajustes: 'id, fecha, productoId',
cuadres: 'id, fecha'
});
this.version(2).stores({
productores: 'id, nombre, activo',
productos: 'id, productorId, nombrePresentacion, [productorId+nombrePresentacion]',
movimientosInventario: 'id, fecha, tipo, productoId',
ventas: 'id, fecha',
ventaLineas: 'id, ventaId, productoId, formaPago',
gastos: 'id, fecha',
ajustes: 'id, fecha, productoId',
cuadres: 'id, fecha',
jornadas: 'id, fecha, estado'
});
}
}