Script SQL para crear esquema de base de datos financiera (Opción A)
还没有人认领这个 Issue。
评估
调研方向
首先审查 issue 中提出的 MySQL schema,并解决有关用户、审计历史和类别所有权的未决问题。当一个兼容 MySQL 的 SQL 脚本使用合适的键、类型和引用定义所需的 transactions、budgets 和 savings_goals 表,并在选择时包含 accounts 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Descripción
Crear un script SQL que defina el esquema inicial de la base de datos para un sistema de finanzas personales. Este sistema permitirá registrar transacciones, presupuestos, metas de ahorro y (opcionalmente) usuarios y cuentas. El esquema debe ser compatible con MySQL y cubrir el MVP de la aplicación.
Tablas requeridas:
transactions: registro de ingresos/gastos, categorías y descripción.budgets: presupuestos por categoría y periodo.savings_goals: metas de ahorro con estado.- (Opcional:
accountspara soportar varias cuentas o wallets)
Debe incluir claves primarias, tipos de datos adecuados y referencias entre tablas donde aplique.
Why
- Permite que el backend almacene y consulte los datos financieros de forma estructurada.
- Facilita la generación de reportes “fin de mes”, seguimiento de objetivos y visualización de gastos/ingresos.
- Es fundamental para el funcionamiento de toda la app y para poder avanzar hacia la integración con frontend y generación de reportes.
Possible Implementation & Open Questions
Script SQL sugerido:
CREATE TABLE accounts (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
currency VARCHAR(10) DEFAULT 'MXN',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE transactions (
id INT AUTO_INCREMENT PRIMARY KEY,
account_id INT DEFAULT NULL,
type ENUM('income','expense') NOT NULL,
amount DECIMAL(12,2) NOT NULL,
category VARCHAR(100),
description TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE SET NULL
);
CREATE TABLE budgets (
id INT AUTO_INCREMENT PRIMARY KEY,
account_id INT DEFAULT NULL,
category VARCHAR(100) NOT NULL,
limit_amount DECIMAL(12,2) NOT NULL,
period ENUM('monthly','weekly','yearly') NOT NULL DEFAULT 'monthly',
start_date DATE DEFAULT NULL,
end_date DATE DEFAULT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE SET NULL
);
CREATE TABLE savings_goals (
id INT AUTO_INCREMENT PRIMARY KEY,
account_id INT DEFAULT NULL,
name VARCHAR(100) NOT NULL,
target_amount DECIMAL(12,2) NOT NULL,
saved_amount DECIMAL(12,2) DEFAULT 0.0,
icon VARCHAR(50),
target_date DATE DEFAULT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE SET NULL
);
Preguntas abiertas:
- ¿Es necesario soportar múltiples usuarios o es solo para uso personal? (si sí, agregar tabla users y relación con cuentas)
- ¿Se requiere historial de modificaciones (audit trail)?
- ¿Se usarán categorías predefinidas o personalizables?
Is this something you're interested in working on?
- YES
- NO
- 主要语言
- Python
- 星标
- 284k
- 派生
- 36.3k
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
practical-tutorials/project-based-learning 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 75/100
practical-tutorials/project-based-learning#888 · 3 条评论 ·
-
Broken Link: Erlang -> "Making a Chat App with Erlang, Rebar, Cowboy and Bullet" leads to 404 error 未关闭
难度 1/5 1 小时以内 新手友好度 64/100
practical-tutorials/project-based-learning#840 · 2 条评论 ·
-
BOMOYI 未关闭
难度 5/5 一周以上 新手友好度 20/100
practical-tutorials/project-based-learning#937 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
-
link-rot
难度 4/5 3-5 天 新手友好度 25/100
practical-tutorials/project-based-learning#899 · 1 条评论 ·
查看 practical-tutorials/project-based-learning 的全部 Issue
相似的 Issue
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100