Init: MVP de Gestión de Pagos (Stitch UI + SQLite/PHP)

This commit is contained in:
Ricardo Monla
2026-04-08 23:39:24 -03:00
commit aeceba9095
12 changed files with 870 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
CREATE TABLE IF NOT EXISTS categorias (
id INTEGER PRIMARY KEY AUTOINCREMENT,
nombre TEXT NOT NULL,
icono TEXT NOT NULL,
color_hex TEXT DEFAULT '#005050'
);
CREATE TABLE IF NOT EXISTS movimientos (
id INTEGER PRIMARY KEY AUTOINCREMENT,
tipo TEXT CHECK( tipo IN ('gasto','ingreso') ) NOT NULL,
monto REAL NOT NULL,
fecha TEXT NOT NULL,
notas TEXT,
id_categoria INTEGER,
fecha_creacion DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(id_categoria) REFERENCES categorias(id)
);
-- Insertar algunas categorías por defecto
INSERT INTO categorias (nombre, icono, color_hex) VALUES
('Comida', 'restaurant', '#005050'),
('Vivienda', 'home', '#4d6357'),
('Transporte', 'directions_car', '#264b5c'),
('Servicios', 'bolt', '#3e4948'),
('Entretenimiento', 'movie', '#006a6a'),
('Salario / Ingresos', 'payments', '#006a6a');