feat: estructura base OpenSpec + Skills + arquitectura limpia Capacitor+Dextie
This commit is contained in:
29
packages/data/src/db/schema.ts
Normal file
29
packages/data/src/db/schema.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import Dexie, { Table } from 'dexie';
|
||||
import type { Productor, Producto, MovimientoInventario, Venta, VentaLinea, Gasto, Ajuste, CuadreCaja } from '@toldo/core';
|
||||
|
||||
export class ToldoDB extends Dexie {
|
||||
productores!: Table<Productor, string>;
|
||||
productos!: Table<Producto, string>;
|
||||
movimientosInventario!: Table<MovimientoInventario, string>;
|
||||
ventas!: Table<Venta, string>;
|
||||
ventaLineas!: Table<VentaLinea, string>;
|
||||
gastos!: Table<Gasto, string>;
|
||||
ajustes!: Table<Ajuste, string>;
|
||||
cuadres!: Table<CuadreCaja, string>;
|
||||
|
||||
constructor() {
|
||||
super('ToldoConjuntoDB');
|
||||
this.version(1).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'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const db = new ToldoDB();
|
||||
1
packages/data/src/index.ts
Normal file
1
packages/data/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './db/schema';
|
||||
Reference in New Issue
Block a user