feat: estructura base OpenSpec + Skills + arquitectura limpia Capacitor+Dextie
This commit is contained in:
23
packages/data/package.json
Normal file
23
packages/data/package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@toldo/data",
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@toldo/core": "workspace:*",
|
||||
"dexie": "^4.0.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~6.0.3"
|
||||
}
|
||||
}
|
||||
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';
|
||||
17
packages/data/tsconfig.json
Normal file
17
packages/data/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"paths": {
|
||||
"@toldo/core": ["../core/src"]
|
||||
}
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user